24 lines
379 B
Go
Raw Normal View History

2024-05-17 15:59:51 +08:00
package database
import (
2024-11-02 10:41:31 +08:00
"git.solsynth.dev/hypernet/paperclip/pkg/internal/models"
2024-05-17 15:59:51 +08:00
"gorm.io/gorm"
)
var AutoMaintainRange = []any{
2024-08-18 12:01:41 +08:00
&models.AttachmentPool{},
2024-08-18 16:02:25 +08:00
&models.Attachment{},
2024-08-03 15:43:15 +08:00
&models.StickerPack{},
&models.Sticker{},
2024-05-17 15:59:51 +08:00
}
func RunMigration(source *gorm.DB) error {
if err := source.AutoMigrate(
AutoMaintainRange...,
); err != nil {
return err
}
return nil
}