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{},
|
|
|
|
&models.Post{},
|
2024-02-02 16:50:23 +00:00
|
|
|
&models.PostLike{},
|
|
|
|
&models.PostDislike{},
|
2024-02-04 10:40:20 +00:00
|
|
|
&models.Attachment{},
|
2024-02-01 15:26:17 +00:00
|
|
|
); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|