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
Этот коммит содержится в:
@@ -5261,7 +5261,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "store.sql.schema_version.critical",
|
"id": "store.sql.schema_version.critical",
|
||||||
"translation": "The database schema version of %v cannot be upgraded. You must not skip a version."
|
"translation": "Database schema version %v is no longer supported. This Mattermost server supports automatic upgrades from schema version %v through schema version %v. Downgrades are not supported. Please manually upgrade to at least version %v before continuing"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "store.sql.short_ciphertext",
|
"id": "store.sql.short_ciphertext",
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ const (
|
|||||||
VERSION_3_2_0 = "3.2.0"
|
VERSION_3_2_0 = "3.2.0"
|
||||||
VERSION_3_1_0 = "3.1.0"
|
VERSION_3_1_0 = "3.1.0"
|
||||||
VERSION_3_0_0 = "3.0.0"
|
VERSION_3_0_0 = "3.0.0"
|
||||||
|
OLDEST_SUPPORTED_VERSION = VERSION_3_0_0
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
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 we're not on the current version then it's too old to be upgraded
|
||||||
if sqlStore.GetCurrentSchemaVersion() != model.CurrentVersion {
|
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)
|
time.Sleep(time.Second)
|
||||||
os.Exit(EXIT_TOO_OLD)
|
os.Exit(EXIT_TOO_OLD)
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user