Skip to content

Commit

Permalink
added the ability to exit after migration
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Oct 16, 2023
1 parent d48cad0 commit 844b8f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/utils/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@ func SetupDB() *gorm.DB {
if err := migration.New(db, false).Migrate(); err != nil {
log.WithError(err).Fatal("Failed to migrate database")
}

if os.Getenv("EXIT_AFTER_MIGRATION") == "true" {
log.Info("Exiting after migration")
os.Exit(0)
}
return db
}

0 comments on commit 844b8f5

Please sign in to comment.