Passport/pkg/database/migrator.go

22 lines
376 B
Go
Raw Normal View History

2024-01-06 17:56:32 +00:00
package database
import (
"code.smartsheep.studio/hydrogen/passport/pkg/models"
"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{},
); err != nil {
return err
}
return nil
}