diff options
author | 2021-08-25 15:34:33 +0200 | |
---|---|---|
committer | 2021-08-25 15:34:33 +0200 | |
commit | 2dc9fc1626507bb54417fc4a1920b847cafb27a2 (patch) | |
tree | 4ddeac479b923db38090aac8bd9209f3646851c1 /internal/gtsmodel/mention.go | |
parent | Manually approves followers (#146) (diff) | |
download | gotosocial-2dc9fc1626507bb54417fc4a1920b847cafb27a2.tar.xz |
Pg to bun (#148)
* start moving to bun
* changing more stuff
* more
* and yet more
* tests passing
* seems stable now
* more big changes
* small fix
* little fixes
Diffstat (limited to 'internal/gtsmodel/mention.go')
-rw-r--r-- | internal/gtsmodel/mention.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/internal/gtsmodel/mention.go b/internal/gtsmodel/mention.go index 931e681db..ce5977659 100644 --- a/internal/gtsmodel/mention.go +++ b/internal/gtsmodel/mention.go @@ -23,22 +23,22 @@ import "time" // Mention refers to the 'tagging' or 'mention' of a user within a status. type Mention struct { // ID of this mention in the database - ID string `pg:"type:CHAR(26),pk,notnull,unique"` + ID string `bun:"type:CHAR(26),pk,notnull,unique"` // ID of the status this mention originates from - StatusID string `pg:"type:CHAR(26),notnull"` - Status *Status `pg:"rel:belongs-to"` + StatusID string `bun:"type:CHAR(26),notnull"` + Status *Status `bun:"rel:belongs-to"` // When was this mention created? - CreatedAt time.Time `pg:"type:timestamp,notnull,default:now()"` + CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"` // When was this mention last updated? - UpdatedAt time.Time `pg:"type:timestamp,notnull,default:now()"` + UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"` // What's the internal account ID of the originator of the mention? - OriginAccountID string `pg:"type:CHAR(26),notnull"` - OriginAccount *Account `pg:"rel:has-one"` + OriginAccountID string `bun:"type:CHAR(26),notnull"` + OriginAccount *Account `bun:"rel:belongs-to"` // What's the AP URI of the originator of the mention? - OriginAccountURI string `pg:",notnull"` + OriginAccountURI string `bun:",notnull"` // What's the internal account ID of the mention target? - TargetAccountID string `pg:"type:CHAR(26),notnull"` - TargetAccount *Account `pg:"rel:has-one"` + TargetAccountID string `bun:"type:CHAR(26),notnull"` + TargetAccount *Account `bun:"rel:belongs-to"` // Prevent this mention from generating a notification? Silent bool @@ -54,15 +54,15 @@ type Mention struct { // @whatever_username@example.org // // This will not be put in the database, it's just for convenience. - NameString string `pg:"-"` + NameString string `bun:"-"` // TargetAccountURI is the AP ID (uri) of the user mentioned. // // This will not be put in the database, it's just for convenience. - TargetAccountURI string `pg:"-"` + TargetAccountURI string `bun:"-"` // TargetAccountURL is the web url of the user mentioned. // // This will not be put in the database, it's just for convenience. - TargetAccountURL string `pg:"-"` + TargetAccountURL string `bun:"-"` // A pointer to the gtsmodel account of the mentioned account. } |