mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-27 11:26:22 -07:00
Move successful migration logging to dbupdate.go
This commit is contained in:
parent
ae1aac15cf
commit
5c26c40ef6
2 changed files with 4 additions and 5 deletions
|
@ -137,6 +137,7 @@ func initDB(fatalEv *zerolog.Event, commandLine ...bool) {
|
|||
gcutil.LogInfo().
|
||||
Str("DBtype", systemCritical.DBtype).
|
||||
Str("DBhost", systemCritical.DBhost).
|
||||
Str("DBname", systemCritical.DBname).
|
||||
Msg("Connected to database")
|
||||
|
||||
err := gcsql.CheckAndInitializeDatabase(systemCritical.DBtype, true)
|
||||
|
@ -145,11 +146,6 @@ func initDB(fatalEv *zerolog.Event, commandLine ...bool) {
|
|||
db, err = gcsql.GetDatabase()
|
||||
if err == nil {
|
||||
err = dbupdate.UpdateDatabase(db)
|
||||
if err == nil {
|
||||
gcutil.LogInfo().
|
||||
Int("DBVersion", gcsql.DatabaseVersion).
|
||||
Msg("Database updated successfully")
|
||||
}
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
|
|
|
@ -26,6 +26,9 @@ func UpdateDatabase(db *gcsql.GCDB) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
gcutil.LogInfo().
|
||||
Int("DBVersion", gcsql.DatabaseVersion).
|
||||
Msg("Database updated successfully")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue