Interactive/pkg/database/migrator.go
2024-02-02 23:42:42 +08:00

21 lines
323 B
Go

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{},
&models.Realm{},
&models.Category{},
&models.Tag{},
&models.Post{},
); err != nil {
return err
}
return nil
}