summaryrefslogtreecommitdiff
path: root/internal/gtsmodel/emaildomainblock.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@protonmail.com>2021-08-31 15:59:12 +0200
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2021-09-01 11:11:26 +0200
commit2786b5f88742c3f32b8ed497df3737cb4f57caec (patch)
treec088b71b228a52fb3bbf37628caea82ff7a42067 /internal/gtsmodel/emaildomainblock.go
parentgo fmt (diff)
downloadgotosocial-2786b5f88742c3f32b8ed497df3737cb4f57caec.tar.xz
change muchos things
Diffstat (limited to 'internal/gtsmodel/emaildomainblock.go')
-rw-r--r--internal/gtsmodel/emaildomainblock.go17
1 files changed, 6 insertions, 11 deletions
diff --git a/internal/gtsmodel/emaildomainblock.go b/internal/gtsmodel/emaildomainblock.go
index 1919172fa..38f4a9580 100644
--- a/internal/gtsmodel/emaildomainblock.go
+++ b/internal/gtsmodel/emaildomainblock.go
@@ -22,15 +22,10 @@ import "time"
// EmailDomainBlock represents a domain that the server should automatically reject sign-up requests from.
type EmailDomainBlock struct {
- // ID of this block in the database
- ID string `bun:"type:CHAR(26),pk,notnull,unique"`
- // Email domain to block. Eg. 'gmail.com' or 'hotmail.com'
- Domain string `bun:",notnull"`
- // When was this block created
- CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
- // When was this block updated
- UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
- // Account ID of the creator of this block
- CreatedByAccountID string `bun:"type:CHAR(26),notnull"`
- CreatedByAccount *Account `bun:"rel:belongs-to"`
+ ID string `validate:"required,ulid" bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database
+ CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"` // when was item created
+ UpdatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"` // when was item last updated
+ Domain string `validate:"required,fqdn" bun:",nullzero,notnull"` // Email domain to block. Eg. 'gmail.com' or 'hotmail.com'
+ CreatedByAccountID string `validate:"required,ulid" bun:"type:CHAR(26),nullzero,notnull"` // Account ID of the creator of this block
+ CreatedByAccount *Account `validate:"-" bun:"rel:belongs-to"` // Account corresponding to createdByAccountID
}