26 lines
400 B
Go
Raw Normal View History

2024-02-01 23:26:17 +08:00
package database
import (
"git.solsynth.dev/hydrogen/interactive/pkg/internal/models"
2024-02-01 23:26:17 +08:00
"gorm.io/gorm"
)
2024-05-15 19:45:49 +08:00
var AutoMaintainRange = []any{
2024-04-06 11:47:58 +08:00
&models.Account{},
&models.Realm{},
&models.Category{},
&models.Tag{},
2024-05-15 19:45:49 +08:00
&models.Post{},
2024-04-06 11:47:58 +08:00
&models.Reaction{},
}
2024-02-01 23:26:17 +08:00
func RunMigration(source *gorm.DB) error {
if err := source.AutoMigrate(
2024-05-15 19:45:49 +08:00
AutoMaintainRange...,
2024-02-01 23:26:17 +08:00
); err != nil {
return err
}
return nil
}