Skip to content

Commit

Permalink
🗃️ Fix stickers migration issue
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleSheep2Code committed Aug 3, 2024
1 parent 7af44da commit 7452b07
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/internal/database/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
var AutoMaintainRange = []any{
&models.Account{},
&models.Attachment{},
&models.Sticker{},
&models.StickerPack{},
&models.Sticker{},
}

func RunMigration(source *gorm.DB) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/internal/models/stickers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
2 changes: 1 addition & 1 deletion settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ files_deletion = 4
files_analyze = 4

[debug]
database = false
database = true
print_routes = false

[dealer]
Expand Down

0 comments on commit 7452b07

Please sign in to comment.