4.3.0 version fix and macOS data path.

Fixed my typo with 4.3. version - it is detected as 4.3.0, not 4.3.000.

Possibly, macOS version is now true :).
This commit is contained in:
2016-10-04 18:32:50 +05:00
parent b7e79ce01b
commit 812436fce3
3 changed files with 26 additions and 2 deletions

View File

@@ -51,6 +51,10 @@ func migrate_full(db *Database, version int) {
two_to_three(db)
version = 3
}
if version == 3 {
three_to_four(db)
version = 4
}
}
// Initial database structure.
@@ -75,3 +79,9 @@ func two_to_three(db *Database) {
db.Db.MustExec("CREATE TABLE urt_profiles (name VARCHAR(128) NOT NULL, version VARCHAR(5) NOT NULL DEFAULT '4.3', binary VARCHAR(1024) NOT NULL, second_x_session VARCHAR(1) NOT NULL DEFAULT '0', additional_parameters VARCHAR(1024) NOT NULL DEFAULT '')")
db.Db.MustExec("UPDATE database SET version=3")
}
// UrT version inconsistency.
func three_to_four(db *Database) {
fmt.Println("Upgrading database from 3 to 4...")
db.Db.MustExec("UPDATE urt_profiles SET version='4.3.0' WHERE version='4.3.000'")
}