27 lines
463 B
Go
27 lines
463 B
Go
package database
|
|
|
|
import (
|
|
"git.solsynth.dev/hydrogen/interactive/pkg/models"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
func RunMigration(source *gorm.DB) error {
|
|
if err := source.AutoMigrate(
|
|
&models.Account{},
|
|
&models.AccountMembership{},
|
|
&models.Realm{},
|
|
&models.RealmMember{},
|
|
&models.Category{},
|
|
&models.Tag{},
|
|
&models.Moment{},
|
|
&models.Article{},
|
|
&models.Comment{},
|
|
&models.Reaction{},
|
|
&models.Attachment{},
|
|
); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|