* db: upgrade db to 5.22
Этот коммит содержится в:
Carlos Tadeu Panato Junior
2020-04-07 11:44:08 +02:00
коммит произвёл GitHub
родитель 6f6793e579
Коммит ff505457a2

Просмотреть файл

@@ -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)
}
}