start moving some database stuff around

This commit is contained in:
tsmethurst 2021-08-17 11:18:43 +02:00
commit f409f7c65a
43 changed files with 1230 additions and 1223 deletions

View file

@ -48,18 +48,23 @@ type Status struct {
Local bool
// which account posted this status?
AccountID string `pg:"type:CHAR(26),notnull"`
Account *Account `pg:"rel:has-one"`
// AP uri of the owner of this status
AccountURI string
// id of the status this status is a reply to
InReplyToID string `pg:"type:CHAR(26)"`
InReplyTo *Status `pg:"-"`
// AP uri of the status this status is a reply to
InReplyToURI string
// id of the account that this status replies to
InReplyToAccountID string `pg:"type:CHAR(26)"`
InReplyToAccount *Account `pg:"-"`
// id of the status this status is a boost of
BoostOfID string `pg:"type:CHAR(26)"`
BoostOf *Status `pg:"-"`
// id of the account that owns the boosted status
BoostOfAccountID string `pg:"type:CHAR(26)"`
BoostOfAccount *Account `pg:"-"`
// cw string for this status
ContentWarning string
// visibility entry for this status
@ -70,6 +75,7 @@ type Status struct {
Language string
// Which application was used to create this status?
CreatedWithApplicationID string `pg:"type:CHAR(26)"`
CreatedWithApplication *Application `pg:"-"`
// advanced visibility for this status
VisibilityAdvanced *VisibilityAdvanced
// What is the activitystreams type of this status? See: https://www.w3.org/TR/activitystreams-vocabulary/#object-types
@ -88,7 +94,7 @@ type Status struct {
*/
// Account that created this status
GTSAuthorAccount *Account `pg:"-"`
// Mentions created in this status
GTSMentions []*Mention `pg:"-"`
// Hashtags used in this status
@ -98,13 +104,13 @@ type Status struct {
// MediaAttachments used in this status
GTSMediaAttachments []*MediaAttachment `pg:"-"`
// Status being replied to
GTSReplyToStatus *Status `pg:"-"`
// Account being replied to
GTSReplyToAccount *Account `pg:"-"`
// Status being boosted
GTSBoostedStatus *Status `pg:"-"`
// Account of the boosted status
GTSBoostedAccount *Account `pg:"-"`
}
// Visibility represents the visibility granularity of a status.

View file

@ -28,17 +28,13 @@ type StatusFave struct {
CreatedAt time.Time `pg:"type:timestamp,notnull,default:now()"`
// id of the account that created ('did') the fave
AccountID string `pg:"type:CHAR(26),notnull"`
Account *Account `pg:"rel:has-one"`
// id the account owning the faved status
TargetAccountID string `pg:"type:CHAR(26),notnull"`
TargetAccount *Account `pg:"rel:has-one"`
// database id of the status that has been 'faved'
StatusID string `pg:"type:CHAR(26),notnull"`
Status *Status `pg:"rel:has-one"`
// ActivityPub URI of this fave
URI string `pg:",notnull"`
// GTSStatus is the status being interacted with. It won't be put or retrieved from the db, it's just for conveniently passing a pointer around.
GTSStatus *Status `pg:"-"`
// GTSTargetAccount is the account being interacted with. It won't be put or retrieved from the db, it's just for conveniently passing a pointer around.
GTSTargetAccount *Account `pg:"-"`
// GTSFavingAccount is the account doing the faving. It won't be put or retrieved from the db, it's just for conveniently passing a pointer around.
GTSFavingAccount *Account `pg:"-"`
}