mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-26 09:03:32 -06:00
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
This commit is contained in:
parent
071eca20ce
commit
2dc9fc1626
713 changed files with 98694 additions and 22704 deletions
|
|
@ -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.
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue