🐛 Fix migration issue on pools

This commit is contained in:
LittleSheep 2024-08-18 16:02:25 +08:00
parent 98cf753f66
commit a65b761d5e
3 changed files with 4 additions and 4 deletions

View File

@ -6,8 +6,8 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="18dd0d68-b4b8-40db-9734-9119b5c848bd" name="更改" comment=":recycle: Split mark and delete file"> <list default="true" id="18dd0d68-b4b8-40db-9734-9119b5c848bd" name="更改" comment=":recycle: Split mark and delete file">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/services/recycler.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/services/recycler.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/internal/database/migrator.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/database/migrator.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/main.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/main.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/internal/models/pools.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/models/pools.go" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@ -7,8 +7,8 @@ import (
var AutoMaintainRange = []any{ var AutoMaintainRange = []any{
&models.Account{}, &models.Account{},
&models.Attachment{},
&models.AttachmentPool{}, &models.AttachmentPool{},
&models.Attachment{},
&models.StickerPack{}, &models.StickerPack{},
&models.Sticker{}, &models.Sticker{},
} }

View File

@ -10,7 +10,7 @@ type AttachmentPool struct {
Description string `json:"description"` Description string `json:"description"`
Config datatypes.JSONType[AttachmentPoolConfig] `json:"config"` Config datatypes.JSONType[AttachmentPoolConfig] `json:"config"`
Attachments []Attachment `json:"attachments"` Attachments []Attachment `json:"attachments" gorm:"foreignKey:PoolID"`
Account *Account `json:"account"` Account *Account `json:"account"`
AccountID *uint `json:"account_id"` AccountID *uint `json:"account_id"`