Paperclip/pkg/internal/database/migrator.go

25 lines
399 B
Go
Raw Normal View History

2024-05-17 07:59:51 +00:00
package database
import (
2024-06-22 04:18:54 +00:00
"git.solsynth.dev/hydrogen/paperclip/pkg/internal/models"
2024-05-17 07:59:51 +00:00
"gorm.io/gorm"
)
var AutoMaintainRange = []any{
&models.Account{},
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{},
&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
}