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