Paperclip/pkg/internal/database/migrator.go
2024-06-16 23:24:54 +08:00

22 lines
319 B
Go

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
}