summaryrefslogtreecommitdiff
path: root/internal/gtsmodel/account.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2021-09-10 09:08:21 +0100
committerLibravatar GitHub <noreply@github.com>2021-09-10 10:08:21 +0200
commit4c4a622088ef1db208930deb2d00cd1b2bcd708f (patch)
tree2662782d3bf6ec3541e0132e3c225114bdfe364f /internal/gtsmodel/account.go
parentfix up status inreplyto visibility, + small format improvements (#199) (diff)
downloadgotosocial-4c4a622088ef1db208930deb2d00cd1b2bcd708f.tar.xz
Prune unnecessary nullzeros, fixup db tags (#200)
* prune gtsmodel.Account bun tags, add note to gtsmodel dir Signed-off-by: kim (grufwub) <grufwub@gmail.com> * further database tag fixes Signed-off-by: kim (grufwub) <grufwub@gmail.com> * more db tag fixups Signed-off-by: kim (grufwub) <grufwub@gmail.com> * fix removing nullzero for account timestamps... Signed-off-by: kim (grufwub) <grufwub@gmail.com> * add nullzero back to accountid tag Signed-off-by: kim (grufwub) <grufwub@gmail.com> * rename gtsmodel readme Signed-off-by: kim (grufwub) <grufwub@gmail.com>
Diffstat (limited to 'internal/gtsmodel/account.go')
-rw-r--r--internal/gtsmodel/account.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/internal/gtsmodel/account.go b/internal/gtsmodel/account.go
index 67ce05d0b..ef4b66ecf 100644
--- a/internal/gtsmodel/account.go
+++ b/internal/gtsmodel/account.go
@@ -40,18 +40,18 @@ type Account struct {
HeaderMediaAttachmentID string `validate:"omitempty,ulid" bun:"type:CHAR(26),nullzero"` // Database ID of the media attachment, if present
HeaderMediaAttachment *MediaAttachment `validate:"-" bun:"rel:belongs-to"` // MediaAttachment corresponding to headerMediaAttachmentID
HeaderRemoteURL string `validate:"omitempty,url" bun:",nullzero"` // For a non-local account, where can the header be fetched?
- DisplayName string `validate:"-" bun:",nullzero"` // DisplayName for this account. Can be empty, then just the Username will be used for display purposes.
+ DisplayName string `validate:"-" bun:""` // DisplayName for this account. Can be empty, then just the Username will be used for display purposes.
Fields []Field `validate:"-"` // a key/value map of fields that this account has added to their profile
- Note string `validate:"-" bun:",nullzero"` // A note that this account has on their profile (ie., the account's bio/description of themselves)
- Memorial bool `validate:"-" bun:",nullzero,default:false"` // Is this a memorial account, ie., has the user passed away?
- AlsoKnownAs string `validate:"omitempty,ulid" bun:"type:CHAR(26),nullzero"` // This account is associated with x account id
+ Note string `validate:"-" bun:""` // A note that this account has on their profile (ie., the account's bio/description of themselves)
+ Memorial bool `validate:"-" bun:",default:false"` // Is this a memorial account, ie., has the user passed away?
+ AlsoKnownAs string `validate:"omitempty,ulid" bun:"type:CHAR(26),nullzero"` // This account is associated with x account id (TODO: migrate to be AlsoKnownAsID)
MovedToAccountID string `validate:"omitempty,ulid" bun:"type:CHAR(26),nullzero"` // This account has moved this account id in the database
- Bot bool `validate:"-" bun:",nullzero,default:false"` // Does this account identify itself as a bot?
- Reason string `validate:"-" bun:",nullzero"` // What reason was given for signing up when this account was created?
- Locked bool `validate:"-" bun:",nullzero,default:true"` // Does this account need an approval for new followers?
- Discoverable bool `validate:"-" bun:",nullzero,default:false"` // Should this account be shown in the instance's profile directory?
+ Bot bool `validate:"-" bun:",default:false"` // Does this account identify itself as a bot?
+ Reason string `validate:"-" bun:""` // What reason was given for signing up when this account was created?
+ Locked bool `validate:"-" bun:",default:true"` // Does this account need an approval for new followers?
+ Discoverable bool `validate:"-" bun:",default:false"` // Should this account be shown in the instance's profile directory?
Privacy Visibility `validate:"required_without=Domain,omitempty,oneof=public unlocked followers_only mutuals_only direct" bun:",nullzero"` // Default post privacy for this account
- Sensitive bool `validate:"-" bun:",nullzero,default:false"` // Set posts from this account to sensitive by default?
+ Sensitive bool `validate:"-" bun:",default:false"` // Set posts from this account to sensitive by default?
Language string `validate:"omitempty,bcp47_language_tag" bun:",nullzero,notnull,default:'en'"` // What language does this account post in?
URI string `validate:"required,url" bun:",nullzero,notnull,unique"` // ActivityPub URI for this account.
URL string `validate:"required_without=Domain,omitempty,url" bun:",nullzero,unique"` // Web URL for this account's profile
@@ -68,7 +68,7 @@ type Account struct {
SensitizedAt time.Time `validate:"-" bun:"type:timestamp,nullzero"` // When was this account set to have all its media shown as sensitive?
SilencedAt time.Time `validate:"-" bun:"type:timestamp,nullzero"` // When was this account silenced (eg., statuses only visible to followers, not public)?
SuspendedAt time.Time `validate:"-" bun:"type:timestamp,nullzero"` // When was this account suspended (eg., don't allow it to log in/post, don't accept media/posts from this account)
- HideCollections bool `validate:"-" bun:",nullzero,default:false"` // Hide this account's collections
+ HideCollections bool `validate:"-" bun:",default:false"` // Hide this account's collections
SuspensionOrigin string `validate:"omitempty,ulid" bun:"type:CHAR(26),nullzero"` // id of the database entry that caused this account to become suspended -- can be an account ID or a domain block ID
}