🗃️ Fix stickers migration issue

This commit is contained in:
LittleSheep 2024-08-03 16:30:01 +08:00
parent 7af44da03b
commit 7452b0754d
3 changed files with 3 additions and 3 deletions

View File

@ -8,8 +8,8 @@ import (
var AutoMaintainRange = []any{
&models.Account{},
&models.Attachment{},
&models.Sticker{},
&models.StickerPack{},
&models.Sticker{},
}
func RunMigration(source *gorm.DB) error {

View File

@ -19,7 +19,7 @@ type StickerPack struct {
Prefix string `json:"prefix"`
Name string `json:"name"`
Description string `json:"description"`
Stickers []Sticker `json:"stickers" gorm:"constraint:OnDelete:DELETE"`
Stickers []Sticker `json:"stickers" gorm:"foreignKey:PackID;constraint:OnDelete:CASCADE"`
AccountID uint `json:"account_id"`
Account Account `json:"account"`
}

View File

@ -17,7 +17,7 @@ files_deletion = 4
files_analyze = 4
[debug]
database = false
database = true
print_routes = false
[dealer]