Interactive/pkg/database/migrator.go

21 lines
323 B
Go
Raw Normal View History

2024-02-01 15:26:17 +00:00
package database
import (
"code.smartsheep.studio/hydrogen/interactive/pkg/models"
"gorm.io/gorm"
)
func RunMigration(source *gorm.DB) error {
if err := source.AutoMigrate(
&models.Account{},
2024-02-02 15:42:42 +00:00
&models.Realm{},
&models.Category{},
&models.Tag{},
&models.Post{},
2024-02-01 15:26:17 +00:00
); err != nil {
return err
}
return nil
}