diff options
author | George Goldberg <george@gberg.me> | 2018-05-31 10:25:31 +0100 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2018-05-31 10:25:31 +0100 |
commit | 27e7841a734e9c3ed71f988a653f5865d2ef6f91 (patch) | |
tree | 1ccc65246fb166c25a9923f4e05ad7d6223892d1 /store/sqlstore/upgrade.go | |
parent | e39f5f46f3f6cdcb7ab8aeef8c601047f5942f85 (diff) | |
parent | 994ccf475f96bcad668269fe25b0d22e975bc222 (diff) | |
download | chat-27e7841a734e9c3ed71f988a653f5865d2ef6f91.tar.gz chat-27e7841a734e9c3ed71f988a653f5865d2ef6f91.tar.bz2 chat-27e7841a734e9c3ed71f988a653f5865d2ef6f91.zip |
Merge branch 'advanced-permissions-phase-2'
Diffstat (limited to 'store/sqlstore/upgrade.go')
-rw-r--r-- | store/sqlstore/upgrade.go | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go index 4099ac11a..98a89f36d 100644 --- a/store/sqlstore/upgrade.go +++ b/store/sqlstore/upgrade.go @@ -425,8 +425,24 @@ func UpgradeDatabaseToVersion410(sqlStore SqlStore) { } func UpgradeDatabaseToVersion50(sqlStore SqlStore) { - // TODO: Uncomment following condition when version 3.10.0 is released + // This version of Mattermost includes an App-Layer migration which migrates from hard-coded emojis configured + // in `config.json` to a `Permission` in the database. The migration code can be seen + // in the file `app/app.go` in the function `DoEmojisPermissionsMigration()`. + + // TODO: Uncomment following condition when version 5.0.0 is released //if shouldPerformUpgrade(sqlStore, VERSION_4_10_0, VERSION_5_0_0) { + + sqlStore.CreateColumnIfNotExistsNoDefault("Teams", "SchemeId", "varchar(26)", "varchar(26)") + sqlStore.CreateColumnIfNotExistsNoDefault("Channels", "SchemeId", "varchar(26)", "varchar(26)") + + sqlStore.CreateColumnIfNotExistsNoDefault("TeamMembers", "SchemeUser", "boolean", "boolean") + sqlStore.CreateColumnIfNotExistsNoDefault("TeamMembers", "SchemeAdmin", "boolean", "boolean") + sqlStore.CreateColumnIfNotExistsNoDefault("ChannelMembers", "SchemeUser", "boolean", "boolean") + sqlStore.CreateColumnIfNotExistsNoDefault("ChannelMembers", "SchemeAdmin", "boolean", "boolean") + + sqlStore.CreateColumnIfNotExists("Roles", "BuiltIn", "boolean", "boolean", "0") + sqlStore.GetMaster().Exec("UPDATE Roles SET BuiltIn=true") + sqlStore.GetMaster().Exec("UPDATE Roles SET SchemeManaged=false WHERE Name NOT IN ('system_user', 'system_admin', 'team_user', 'team_admin', 'channel_user', 'channel_admin')") sqlStore.CreateColumnIfNotExists("IncomingWebhooks", "ChannelLocked", "boolean", "boolean", "0") // saveSchemaVersion(sqlStore, VERSION_5_0_0) |