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