Paperclip/pkg/internal/database/migrator.go
2024-06-22 12:18:54 +08:00

22 lines
328 B
Go

package database
import (
"git.solsynth.dev/hydrogen/paperclip/pkg/internal/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
}