From 53507ac2a32a785b5467b1e58d033780d8e02693 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sun, 29 Aug 2021 12:03:08 +0200 Subject: Mention fixup (#167) * rework mention creation a bit * rework mention creation a bit * tidy up status dereferencing * start adding tests for dereferencing * fixups * fix * review changes --- internal/gtsmodel/mention.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/gtsmodel/mention.go') diff --git a/internal/gtsmodel/mention.go b/internal/gtsmodel/mention.go index ce5977659..79556500f 100644 --- a/internal/gtsmodel/mention.go +++ b/internal/gtsmodel/mention.go @@ -25,19 +25,19 @@ type Mention struct { // ID of this mention in the database ID string `bun:"type:CHAR(26),pk,notnull,unique"` // ID of the status this mention originates from - StatusID string `bun:"type:CHAR(26),notnull"` + StatusID string `bun:"type:CHAR(26),notnull,nullzero"` Status *Status `bun:"rel:belongs-to"` // When was this mention created? CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"` // When was this mention last updated? UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"` // What's the internal account ID of the originator of the mention? - OriginAccountID string `bun:"type:CHAR(26),notnull"` + OriginAccountID string `bun:"type:CHAR(26),notnull,nullzero"` OriginAccount *Account `bun:"rel:belongs-to"` // What's the AP URI of the originator of the mention? OriginAccountURI string `bun:",notnull"` // What's the internal account ID of the mention target? - TargetAccountID string `bun:"type:CHAR(26),notnull"` + TargetAccountID string `bun:"type:CHAR(26),notnull,nullzero"` TargetAccount *Account `bun:"rel:belongs-to"` // Prevent this mention from generating a notification? Silent bool -- cgit v1.2.3