diff options
Diffstat (limited to 'internal/gtsmodel/statusbookmark.go')
-rw-r--r-- | internal/gtsmodel/statusbookmark.go | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/internal/gtsmodel/statusbookmark.go b/internal/gtsmodel/statusbookmark.go index 26dafa420..cabf90c06 100644 --- a/internal/gtsmodel/statusbookmark.go +++ b/internal/gtsmodel/statusbookmark.go @@ -20,18 +20,14 @@ package gtsmodel import "time" -// StatusBookmark refers to one account having a 'bookmark' of the status of another account +// StatusBookmark refers to one account having a 'bookmark' of the status of another account. type StatusBookmark struct { - // id of this bookmark in the database - ID string `bun:"type:CHAR(26),pk,notnull,unique"` - // when was this bookmark created - CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"` - // id of the account that created ('did') the bookmarking - AccountID string `bun:"type:CHAR(26),notnull"` - Account *Account `bun:"rel:belongs-to"` - // id the account owning the bookmarked status - TargetAccountID string `bun:"type:CHAR(26),notnull"` - TargetAccount *Account `bun:"rel:belongs-to"` - // database id of the status that has been bookmarked - StatusID string `bun:"type:CHAR(26),notnull"` + ID string `validate:"required,ulid" bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database + CreatedAt time.Time `validate:"required" bun:",nullzero,notnull,default:current_timestamp"` // when was item created + AccountID string `validate:"required,ulid" bun:"type:CHAR(26),nullzero,notnull"` // id of the account that created ('did') the bookmark + Account *Account `validate:"-" bun:"rel:belongs-to"` // account that created the bookmark + TargetAccountID string `validate:"required,ulid" bun:"type:CHAR(26),nullzero,notnull"` // id the account owning the bookmarked status + TargetAccount *Account `validate:"-" bun:"rel:belongs-to"` // account owning the bookmarked status + StatusID string `validate:"required,ulid" bun:"type:CHAR(26),nullzero,notnull"` // database id of the status that has been bookmarked + Status *Status `validate:"-" bun:"rel:belongs-to"` // the bookmarked status } |