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/followrequest.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/followrequest.go')
-rw-r--r-- | internal/gtsmodel/followrequest.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/internal/gtsmodel/followrequest.go b/internal/gtsmodel/followrequest.go index 752c7d0a2..5a6cb5e02 100644 --- a/internal/gtsmodel/followrequest.go +++ b/internal/gtsmodel/followrequest.go @@ -23,21 +23,21 @@ import "time" // FollowRequest represents one account requesting to follow another, and the metadata around that request. type FollowRequest struct { // id of this follow request in the database - ID string `pg:"type:CHAR(26),pk,notnull,unique"` + ID string `bun:"type:CHAR(26),pk,notnull,unique"` // When was this follow request created? - CreatedAt time.Time `pg:"type:timestamp,notnull,default:now()"` + CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"` // When was this follow request last updated? - UpdatedAt time.Time `pg:"type:timestamp,notnull,default:now()"` + UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"` // Who does this follow request originate from? - AccountID string `pg:"type:CHAR(26),unique:srctarget,notnull"` - Account Account `pg:"rel:has-one"` + AccountID string `bun:"type:CHAR(26),unique:frsrctarget,notnull"` + Account *Account `bun:"rel:belongs-to"` // Who is the target of this follow request? - TargetAccountID string `pg:"type:CHAR(26),unique:srctarget,notnull"` - TargetAccount Account `pg:"rel:has-one"` + TargetAccountID string `bun:"type:CHAR(26),unique:frsrctarget,notnull"` + TargetAccount *Account `bun:"rel:belongs-to"` // Does this follow also want to see reblogs and not just posts? - ShowReblogs bool `pg:"default:true"` + ShowReblogs bool `bun:"default:true"` // What is the activitypub URI of this follow request? - URI string `pg:",unique"` + URI string `bun:",unique,nullzero"` // does the following account want to be notified when the followed account posts? Notify bool } |