diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go index b834d811e9..971fc38fe6 100644 --- a/store/sqlstore/upgrade.go +++ b/store/sqlstore/upgrade.go @@ -18,7 +18,8 @@ import ( ) const ( - CURRENT_SCHEMA_VERSION = VERSION_5_23_0 + CURRENT_SCHEMA_VERSION = VERSION_5_24_0 + VERSION_5_24_0 = "5.24.0" VERSION_5_23_0 = "5.23.0" VERSION_5_22_0 = "5.22.0" VERSION_5_21_0 = "5.21.0" @@ -794,13 +795,11 @@ func upgradeDatabaseToVersion523(sqlStore SqlStore) { } func upgradeDatabaseToVersion524(sqlStore SqlStore) { - // TODO: uncomment when the time arrive to upgrade the DB for 5.24 - // if shouldPerformUpgrade(sqlStore, VERSION_5_23_0, VERSION_5_24_0) { + if shouldPerformUpgrade(sqlStore, VERSION_5_23_0, VERSION_5_24_0) { + sqlStore.CreateColumnIfNotExists("UserGroups", "AllowReference", "boolean", "boolean", "0") + sqlStore.GetMaster().Exec("UPDATE UserGroups SET Name = null, AllowReference = false") + sqlStore.AlterPrimaryKey("Reactions", []string{"PostId", "UserId", "EmojiName"}) - sqlStore.CreateColumnIfNotExists("UserGroups", "AllowReference", "boolean", "boolean", "0") - sqlStore.GetMaster().Exec("UPDATE UserGroups SET Name = null, AllowReference = false") - sqlStore.AlterPrimaryKey("Reactions", []string{"PostId", "UserId", "EmojiName"}) - - // saveSchemaVersion(sqlStore, VERSION_5_24_0) - // } + saveSchemaVersion(sqlStore, VERSION_5_24_0) + } }