Paperclip/pkg/internal/database/migrator.go

22 lines
328 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{},
&models.Attachment{},
}
func RunMigration(source *gorm.DB) error {
if err := source.AutoMigrate(
AutoMaintainRange...,
); err != nil {
return err
}
return nil
}