diff options
author | 2021-08-20 12:26:56 +0200 | |
---|---|---|
committer | 2021-08-20 12:26:56 +0200 | |
commit | 4920229a3b6e1d7dde536bc9ff766542b05d935c (patch) | |
tree | a9423beccec5331c372f01eedf38949dfb171e9e /internal/gtsmodel/mention.go | |
parent | Text/status parsing fixes (#141) (diff) | |
download | gotosocial-4920229a3b6e1d7dde536bc9ff766542b05d935c.tar.xz |
Database updates (#144)
* start moving some database stuff around
* continue moving db stuff around
* more fiddling
* more updates
* and some more
* and yet more
* i broke SOMETHING but what, it's a mystery
* tidy up
* vendor ttlcache
* use ttlcache
* fix up some tests
* rename some stuff
* little reminder
* some more updates
Diffstat (limited to 'internal/gtsmodel/mention.go')
-rw-r--r-- | internal/gtsmodel/mention.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/internal/gtsmodel/mention.go b/internal/gtsmodel/mention.go index 47c780521..931e681db 100644 --- a/internal/gtsmodel/mention.go +++ b/internal/gtsmodel/mention.go @@ -25,17 +25,20 @@ type Mention struct { // ID of this mention in the database ID string `pg:"type:CHAR(26),pk,notnull,unique"` // ID of the status this mention originates from - StatusID string `pg:"type:CHAR(26),notnull"` + StatusID string `pg:"type:CHAR(26),notnull"` + Status *Status `pg:"rel:belongs-to"` // When was this mention created? CreatedAt time.Time `pg:"type:timestamp,notnull,default:now()"` // When was this mention last updated? UpdatedAt time.Time `pg:"type:timestamp,notnull,default:now()"` // What's the internal account ID of the originator of the mention? - OriginAccountID string `pg:"type:CHAR(26),notnull"` + OriginAccountID string `pg:"type:CHAR(26),notnull"` + OriginAccount *Account `pg:"rel:has-one"` // What's the AP URI of the originator of the mention? OriginAccountURI string `pg:",notnull"` // What's the internal account ID of the mention target? - TargetAccountID string `pg:"type:CHAR(26),notnull"` + TargetAccountID string `pg:"type:CHAR(26),notnull"` + TargetAccount *Account `pg:"rel:has-one"` // Prevent this mention from generating a notification? Silent bool @@ -52,14 +55,14 @@ type Mention struct { // // This will not be put in the database, it's just for convenience. NameString string `pg:"-"` - // MentionedAccountURI is the AP ID (uri) of the user mentioned. + // TargetAccountURI is the AP ID (uri) of the user mentioned. // // This will not be put in the database, it's just for convenience. - MentionedAccountURI string `pg:"-"` - // MentionedAccountURL is the web url of the user mentioned. + TargetAccountURI string `pg:"-"` + // TargetAccountURL is the web url of the user mentioned. // // This will not be put in the database, it's just for convenience. - MentionedAccountURL string `pg:"-"` + TargetAccountURL string `pg:"-"` // A pointer to the gtsmodel account of the mentioned account. - GTSAccount *Account `pg:"-"` + } |