Skip to content

Commit

Permalink
make sure we migrate the database models.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Nov 20, 2023
1 parent dbd868c commit a161f41
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/pkg/database/gorm_repository_migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ func (gr *GormRepository) Migrate() error {
})

if err := m.Migrate(); err != nil {
gr.Logger.Errorf("Database migration failed with error. \n Please open a github issue at https://github.com/fastenhealth/fasten-onprem and attach a copy of your fasten.db file. \n %v", err)
gr.Logger.Errorf("Database migration failed with error. \n Please open a github issue at https://github.com/fastenhealth/fasten-onprem. \n %v", err)
return err
}

//TODO: final migration step. This should not be necessary once we do true migrations for the databaseModels.
if err := databaseModel.Migrate(gr.GormClient); err != nil {
gr.Logger.Errorf("Final Database migration failed with error.\n Please open a github issue at https://github.com/fastenhealth/fasten-onprem. \n %v", err)
}

gr.Logger.Infoln("Database migration completed successfully")
return nil
}

0 comments on commit a161f41

Please sign in to comment.