fixed incorrect if breaking test db
This commit is contained in:
parent
dfdbf2b63e
commit
dc0b37e564
1 changed files with 9 additions and 9 deletions
|
@ -28,15 +28,15 @@ func Init_testdb(DB_TYPE string, DB_CONNECTION_STRING string) {
|
||||||
|
|
||||||
_, err = os.Stat(cwd + DB_CONNECTION_STRING)
|
_, err = os.Stat(cwd + DB_CONNECTION_STRING)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Debug().Msg("No existing test.db file found")
|
||||||
|
} else {
|
||||||
log.Debug().Msg("Found existing test.db file. Attempting to delete")
|
log.Debug().Msg("Found existing test.db file. Attempting to delete")
|
||||||
err = os.Remove(DB_CONNECTION_STRING)
|
err = os.Remove(cwd + DB_CONNECTION_STRING)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn().Err(err).Msg("Failed to delete testing db. Continueing anyways")
|
log.Warn().Err(err).Msg("Failed to delete testing db. Continueing anyways")
|
||||||
} else {
|
} else {
|
||||||
log.Debug().Msg("Deleted test.db file successfully")
|
log.Debug().Msg("Deleted test.db file successfully")
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
log.Debug().Msg("No existing test.db file found")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
db, err := sqlx.Connect(DB_TYPE, DB_CONNECTION_STRING)
|
db, err := sqlx.Connect(DB_TYPE, DB_CONNECTION_STRING)
|
||||||
|
|
Loading…
Reference in a new issue