diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go index 308e9709f1..a94040d114 100644 --- a/store/sqlstore/upgrade.go +++ b/store/sqlstore/upgrade.go @@ -18,7 +18,8 @@ import ( ) const ( - CURRENT_SCHEMA_VERSION = VERSION_5_21_0 + CURRENT_SCHEMA_VERSION = VERSION_5_22_0 + VERSION_5_22_0 = "5.22.0" VERSION_5_21_0 = "5.21.0" VERSION_5_20_0 = "5.20.0" VERSION_5_19_0 = "5.19.0" @@ -772,16 +773,14 @@ func upgradeDatabaseToVersion521(sqlStore SqlStore) { } func upgradeDatabaseToVersion522(sqlStore SqlStore) { - // if shouldPerformUpgrade(sqlStore, VERSION_5_21_0, VERSION_5_22_0) { - sqlStore.CreateIndexIfNotExists("idx_teams_scheme_id", "Teams", "SchemeId") - sqlStore.CreateIndexIfNotExists("idx_channels_scheme_id", "Channels", "SchemeId") - sqlStore.CreateIndexIfNotExists("idx_channels_scheme_id", "Channels", "SchemeId") - sqlStore.CreateIndexIfNotExists("idx_schemes_channel_guest_role", "Schemes", "DefaultChannelGuestRole") - sqlStore.CreateIndexIfNotExists("idx_schemes_channel_user_role", "Schemes", "DefaultChannelUserRole") - sqlStore.CreateIndexIfNotExists("idx_schemes_channel_admin_role", "Schemes", "DefaultChannelAdminRole") - // sqlStore.CreateColumnIfNotExistsNoDefault("Bots", "LastIconUpdate", "bigint", "bigint") - // sqlStore.AlterPrimaryKey("Reactions", []string{"PostId", "UserId", "EmojiName"}) + if shouldPerformUpgrade(sqlStore, VERSION_5_21_0, VERSION_5_22_0) { + sqlStore.CreateIndexIfNotExists("idx_teams_scheme_id", "Teams", "SchemeId") + sqlStore.CreateIndexIfNotExists("idx_channels_scheme_id", "Channels", "SchemeId") + sqlStore.CreateIndexIfNotExists("idx_channels_scheme_id", "Channels", "SchemeId") + sqlStore.CreateIndexIfNotExists("idx_schemes_channel_guest_role", "Schemes", "DefaultChannelGuestRole") + sqlStore.CreateIndexIfNotExists("idx_schemes_channel_user_role", "Schemes", "DefaultChannelUserRole") + sqlStore.CreateIndexIfNotExists("idx_schemes_channel_admin_role", "Schemes", "DefaultChannelAdminRole") - // saveSchemaVersion(sqlStore, VERSION_5_22_0) - // } + saveSchemaVersion(sqlStore, VERSION_5_22_0) + } }