Interactive/pkg/database/migrator.go

27 lines
469 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-03 07:20:32 +00:00
&models.AccountMembership{},
2024-02-02 15:42:42 +00:00
&models.Realm{},
2024-02-09 07:19:43 +00:00
&models.RealmMember{},
2024-02-02 15:42:42 +00:00
&models.Category{},
&models.Tag{},
2024-03-02 17:23:11 +00:00
&models.Moment{},
&models.Article{},
&models.Comment{},
&models.Reaction{},
2024-02-04 10:40:20 +00:00
&models.Attachment{},
2024-02-01 15:26:17 +00:00
); err != nil {
return err
}
return nil
}