Messaging/pkg/database/migrator.go

20 lines
311 B
Go
Raw Normal View History

2024-03-26 15:05:13 +00:00
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
}