change muchos things

This commit is contained in:
tsmethurst
2021-08-31 15:59:12 +02:00
parent fffff93b75
commit 2786b5f887
70 changed files with 999 additions and 570 deletions

View File

@@ -22,22 +22,14 @@ 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 `bun:"type:CHAR(26),pk,notnull,unique"`
// When was this follow request created?
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
// When was this follow request last updated?
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
// Who does this follow request originate from?
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 `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 `bun:"default:true"`
// What is the activitypub URI of this follow request?
URI string `bun:",unique,nullzero"`
// does the following account want to be notified when the followed account posts?
Notify bool
ID string `validate:"required,ulid" bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database
CreatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"` // when was item created
UpdatedAt time.Time `validate:"-" bun:",nullzero,notnull,default:current_timestamp"` // when was item last updated
URI string `validate:"required,url" bun:",notnull,nullzero,unique"` // ActivityPub uri of this follow (request).
AccountID string `validate:"required,ulid" bun:"type:CHAR(26),unique:frsrctarget,notnull"` // Who does this follow request originate from?
Account *Account `validate:"-" bun:"rel:belongs-to"` // Account corresponding to accountID
TargetAccountID string `validate:"required,ulid" bun:"type:CHAR(26),unique:frsrctarget,notnull"` // Who is the target of this follow request?
TargetAccount *Account `validate:"-" bun:"rel:belongs-to"` // Account corresponding to targetAccountID
ShowReblogs bool `validate:"-" bun:",nullzero,default:true"` // Does this follow also want to see reblogs and not just posts?
Notify bool `validate:"-" bun:",nullzero,default:false"` // does the following account want to be notified when the followed account posts?
}