Paperclip/pkg/internal/database/migrator.go
2024-11-03 01:53:57 +08:00

24 lines
379 B
Go

package database
import (
"git.solsynth.dev/hypernet/paperclip/pkg/internal/models"
"gorm.io/gorm"
)
var AutoMaintainRange = []any{
&models.AttachmentPool{},
&models.Attachment{},
&models.StickerPack{},
&models.Sticker{},
}
func RunMigration(source *gorm.DB) error {
if err := source.AutoMigrate(
AutoMaintainRange...,
); err != nil {
return err
}
return nil
}