Messaging/pkg/database/migrator.go

21 lines
332 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{},
2024-03-30 09:10:36 +00:00
&models.Message{},
2024-03-26 15:05:13 +00:00
&models.Attachment{},
); err != nil {
return err
}
return nil
}