Messaging/pkg/database/migrator.go
2024-03-26 23:05:13 +08:00

20 lines
311 B
Go

package database
import (
"git.solsynth.dev/hydrogen/messaging/pkg/models"
"gorm.io/gorm"
)
func RunMigration(source *gorm.DB) error {
if err := source.AutoMigrate(
&models.Account{},
&models.Channel{},
&models.ChannelMember{},
&models.Attachment{},
); err != nil {
return err
}
return nil
}