Passport/pkg/database/migrator.go

27 lines
506 B
Go
Raw Normal View History

2024-01-06 17:56:32 +00:00
package database
import (
2024-03-20 12:56:43 +00:00
"git.solsynth.dev/hydrogen/identity/pkg/models"
2024-01-06 17:56:32 +00:00
"gorm.io/gorm"
)
func RunMigration(source *gorm.DB) error {
if err := source.AutoMigrate(
&models.Account{},
&models.AuthFactor{},
2024-01-28 08:17:38 +00:00
&models.AccountProfile{},
2024-01-06 17:56:32 +00:00
&models.AccountContact{},
&models.AuthSession{},
&models.AuthChallenge{},
2024-01-28 16:32:39 +00:00
&models.MagicToken{},
2024-01-30 07:57:49 +00:00
&models.ThirdClient{},
2024-01-30 09:57:23 +00:00
&models.ActionEvent{},
2024-02-01 07:08:40 +00:00
&models.Notification{},
2024-02-07 15:15:16 +00:00
&models.NotificationSubscriber{},
2024-01-06 17:56:32 +00:00
); err != nil {
return err
}
return nil
}