2024-02-01 23:26:17 +08:00
|
|
|
package database
|
|
|
|
|
|
|
|
import (
|
2024-03-20 20:57:21 +08:00
|
|
|
"git.solsynth.dev/hydrogen/interactive/pkg/models"
|
2024-02-01 23:26:17 +08:00
|
|
|
"gorm.io/gorm"
|
|
|
|
)
|
|
|
|
|
|
|
|
func RunMigration(source *gorm.DB) error {
|
|
|
|
if err := source.AutoMigrate(
|
|
|
|
&models.Account{},
|
2024-02-03 15:20:32 +08:00
|
|
|
&models.AccountMembership{},
|
2024-02-02 23:42:42 +08:00
|
|
|
&models.Realm{},
|
2024-02-09 15:19:43 +08:00
|
|
|
&models.RealmMember{},
|
2024-02-02 23:42:42 +08:00
|
|
|
&models.Category{},
|
|
|
|
&models.Tag{},
|
2024-03-03 01:23:11 +08:00
|
|
|
&models.Moment{},
|
|
|
|
&models.Article{},
|
|
|
|
&models.Comment{},
|
2024-03-03 12:17:18 +08:00
|
|
|
&models.Reaction{},
|
2024-02-04 18:40:20 +08:00
|
|
|
&models.Attachment{},
|
2024-02-01 23:26:17 +08:00
|
|
|
); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|