mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-27 07:22:29 +02:00
Skip re-initializing tables when running in prod to make server startup faster
This commit is contained in:
parent
29108dd15f
commit
b733878878
@ -89,10 +89,12 @@ func OpenDB() (*database.DB, error) {
|
||||
}
|
||||
}
|
||||
fmt.Println("AutoMigrating DB tables")
|
||||
if !isProductionEnvironment() {
|
||||
err := db.AddDatabaseTables()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create underlying DB tables: %w", err)
|
||||
}
|
||||
}
|
||||
return db, nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user