Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion models/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type Instance struct {
UpdatedAt time.Time
Domain string `gorm:"size:64;uniqueIndex"`
AdminID *snowflake.ID
Admin *Account `gorm:"constraint:OnDelete:CASCADE;<-:create;"` // the admin account for this instance
Admin *Account `gorm:"foreignKey:AdminID;constraint:OnDelete:CASCADE;<-:create;"` // the admin account for this instance
SourceURL string
Title string `gorm:"size:64"`
ShortDescription string
Expand Down
2 changes: 1 addition & 1 deletion models/relationship.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Relationship struct {
ActorID snowflake.ID `gorm:"primarykey;autoIncrement:false"`
Actor *Actor `gorm:"constraint:OnDelete:CASCADE;<-:false;"`
TargetID snowflake.ID `gorm:"primarykey;autoIncrement:false"`
Target *Actor `gorm:"constraint:OnDelete:CASCADE;<-:false;"`
Target *Actor `gorm:"foreignKey:TargetID;constraint:OnDelete:CASCADE;<-:false;"`
Muting bool `gorm:"not null;default:false"`
Blocking bool `gorm:"not null;default:false"`
BlockedBy bool `gorm:"not null;default:false"`
Expand Down
2 changes: 1 addition & 1 deletion models/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Status struct {
ReblogsCount int `gorm:"not null;default:0"`
FavouritesCount int `gorm:"not null;default:0"`
ReblogID *snowflake.ID
Reblog *Status `gorm:"constraint:OnDelete:CASCADE;<-:false;"` // don't update reblog on status update
Reblog *Status `gorm:"foreignKey:ReblogID;constraint:OnDelete:CASCADE;<-:false;"` // don't update reblog on status update
Reaction *Reaction `gorm:"constraint:OnDelete:CASCADE;<-:false;"` // don't update reaction on status update
Attachments []*StatusAttachment `gorm:"constraint:OnDelete:CASCADE;"`
Mentions []StatusMention `gorm:"constraint:OnDelete:CASCADE;"`
Expand Down