Paperclip/pkg/database/migrator.go

22 lines
319 B
Go
Raw Normal View History

2024-05-17 07:59:51 +00:00
package database
import (
"git.solsynth.dev/hydrogen/paperclip/pkg/models"
"gorm.io/gorm"
)
var AutoMaintainRange = []any{
&models.Account{},
&models.Attachment{},
}
func RunMigration(source *gorm.DB) error {
if err := source.AutoMigrate(
AutoMaintainRange...,
); err != nil {
return err
}
return nil
}