Fix mysql Foreign key constraint error
This commit is contained in:
@@ -9,7 +9,7 @@ type Post struct {
|
||||
}
|
||||
|
||||
type Account struct {
|
||||
AccId string `json:"id" gorm:"primaryKey;index"`
|
||||
AccId string `json:"id" gorm:"primaryKey;column:acc_id;type:varchar(19);index"`
|
||||
Username string `json:"username"`
|
||||
Acct string `json:"acct"`
|
||||
DisplayName string `json:"display_name"`
|
||||
@@ -19,12 +19,12 @@ type Account struct {
|
||||
}
|
||||
|
||||
type MediaAttachment struct {
|
||||
ID string `json:"id" gorm:"primaryKey"`
|
||||
ID string `json:"id" gorm:"primaryKey;type:varchar(19)"`
|
||||
Type string `json:"type"`
|
||||
Url string `json:"url"`
|
||||
PreviewUrl string `json:"preview_url"`
|
||||
RemoteUrl string `json:"remote_url"`
|
||||
PostID string `gorm:"index:idx_post_approved,post_id;index:idx_post_id"`
|
||||
PostID string `gorm:"index:idx_post_approved,post_id;index:idx_post_id;type:varchar(19)"`
|
||||
Approved bool `json:"approved" gorm:"index:idx_post_approved"`
|
||||
Rejected bool `json:"rejected" gorm:"index:idx_post_rejected"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user