diff options
author | Jonathan <jonfritz@gmail.com> | 2017-08-04 12:44:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-04 12:44:44 -0400 |
commit | 28726460d76d942f4d9995e417168c687310034f (patch) | |
tree | e0cd4e07dd6a7b2d5f92a568a1356bb70bdf82b2 /store/sql_upgrade.go | |
parent | a5f1a77fa539763635a669162f81dfbb70ccee5b (diff) | |
download | chat-28726460d76d942f4d9995e417168c687310034f.tar.gz chat-28726460d76d942f4d9995e417168c687310034f.tar.bz2 chat-28726460d76d942f4d9995e417168c687310034f.zip |
PLT-7223: Update "Database schema cannot be upgraded" error message to indicate expected version (#7079)
* PLT-7223: Updated error message to include relevant schema versions
* PLT-7223: Removed unit test. It poisons database state, and there's no recovery mechanism, because the code under test causes an ungraceful exit, so we can't fix the database in a defer statement. This causes the next test execution or server start to fail.
* PLT-7223: Incorporated @crspeller's suggestions into error message string
Diffstat (limited to 'store/sql_upgrade.go')
-rw-r--r-- | store/sql_upgrade.go | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/store/sql_upgrade.go b/store/sql_upgrade.go index 157a85507..1ea9496f5 100644 --- a/store/sql_upgrade.go +++ b/store/sql_upgrade.go @@ -15,19 +15,20 @@ import ( ) const ( - VERSION_4_1_0 = "4.1.0" - VERSION_4_0_0 = "4.0.0" - VERSION_3_10_0 = "3.10.0" - VERSION_3_9_0 = "3.9.0" - VERSION_3_8_0 = "3.8.0" - VERSION_3_7_0 = "3.7.0" - VERSION_3_6_0 = "3.6.0" - VERSION_3_5_0 = "3.5.0" - VERSION_3_4_0 = "3.4.0" - VERSION_3_3_0 = "3.3.0" - VERSION_3_2_0 = "3.2.0" - VERSION_3_1_0 = "3.1.0" - VERSION_3_0_0 = "3.0.0" + VERSION_4_1_0 = "4.1.0" + VERSION_4_0_0 = "4.0.0" + VERSION_3_10_0 = "3.10.0" + VERSION_3_9_0 = "3.9.0" + VERSION_3_8_0 = "3.8.0" + VERSION_3_7_0 = "3.7.0" + VERSION_3_6_0 = "3.6.0" + VERSION_3_5_0 = "3.5.0" + VERSION_3_4_0 = "3.4.0" + VERSION_3_3_0 = "3.3.0" + VERSION_3_2_0 = "3.2.0" + VERSION_3_1_0 = "3.1.0" + VERSION_3_0_0 = "3.0.0" + OLDEST_SUPPORTED_VERSION = VERSION_3_0_0 ) const ( @@ -66,7 +67,7 @@ func UpgradeDatabase(sqlStore SqlStore) { // If we're not on the current version then it's too old to be upgraded if sqlStore.GetCurrentSchemaVersion() != model.CurrentVersion { - l4g.Critical(utils.T("store.sql.schema_version.critical"), sqlStore.GetCurrentSchemaVersion()) + l4g.Critical(utils.T("store.sql.schema_version.critical"), sqlStore.GetCurrentSchemaVersion(), OLDEST_SUPPORTED_VERSION, model.CurrentVersion, OLDEST_SUPPORTED_VERSION) time.Sleep(time.Second) os.Exit(EXIT_TOO_OLD) } |