fixed issues with first-time setup, added config.db.port
This commit is contained in:
parent
7bea6b548e
commit
3d674515ce
4 changed files with 26 additions and 12 deletions
|
@ -20,9 +20,13 @@ func CheckDBVersionAndMigrate(db *sqlx.DB) {
|
|||
)
|
||||
|
||||
oldDBVersion := 0
|
||||
|
||||
err := db.Get(&oldDBVersion, "SELECT MAX(version) FROM schema_version")
|
||||
schemaVersionCount := 0
|
||||
err := db.Get(&schemaVersionCount, "SELECT COUNT(*) FROM schema_version")
|
||||
if err != nil { panic(err) }
|
||||
if schemaVersionCount > 0 {
|
||||
err := db.Get(&oldDBVersion, "SELECT MAX(version) FROM schema_version")
|
||||
if err != nil { panic(err) }
|
||||
}
|
||||
|
||||
for oldDBVersion < DB_VERSION {
|
||||
switch oldDBVersion {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue