diff options
author | 2021-09-01 11:45:01 +0200 | |
---|---|---|
committer | 2021-09-01 11:45:01 +0200 | |
commit | 684bd56528c5ffa37af8340b8b141fe390dd05a4 (patch) | |
tree | 4a78d70c2ca7f15e47f8a2e6bc51d62c99b0f52d /internal/db/bundb/migrations/20210816411877_struct_validation/emaildomainblock.go | |
parent | Merge branch 'struct_validation' of github.com:superseriousbusiness/gotosocia... (diff) | |
download | gotosocial-684bd56528c5ffa37af8340b8b141fe390dd05a4.tar.xz |
move oauth models into gtsmodel
Diffstat (limited to 'internal/db/bundb/migrations/20210816411877_struct_validation/emaildomainblock.go')
-rw-r--r-- | internal/db/bundb/migrations/20210816411877_struct_validation/emaildomainblock.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/internal/db/bundb/migrations/20210816411877_struct_validation/emaildomainblock.go b/internal/db/bundb/migrations/20210816411877_struct_validation/emaildomainblock.go new file mode 100644 index 000000000..38f4a9580 --- /dev/null +++ b/internal/db/bundb/migrations/20210816411877_struct_validation/emaildomainblock.go @@ -0,0 +1,31 @@ +/* + GoToSocial + Copyright (C) 2021 GoToSocial Authors admin@gotosocial.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +package gtsmodel + +import "time" + +// EmailDomainBlock represents a domain that the server should automatically reject sign-up requests from. +type EmailDomainBlock struct { + 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 +} |