summaryrefslogtreecommitdiffstats
path: root/store
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2018-07-02 11:03:00 +0100
committerGitHub <noreply@github.com>2018-07-02 11:03:00 +0100
commit4ccb8b7cff7e23b8b3dc21b80b1317f2104307f7 (patch)
treeddbef8913d32a12d61662d6389eb97c05a6f58d7 /store
parent2362a5b7f7c2b4bf2b35b104e8616d847b33b0be (diff)
downloadchat-4ccb8b7cff7e23b8b3dc21b80b1317f2104307f7.tar.gz
chat-4ccb8b7cff7e23b8b3dc21b80b1317f2104307f7.tar.bz2
chat-4ccb8b7cff7e23b8b3dc21b80b1317f2104307f7.zip
Add note on 5.0->4.10 downgrade in upgrade.go (#9029)
Diffstat (limited to 'store')
-rw-r--r--store/sqlstore/upgrade.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go
index fc2d53235..1fbbc73f5 100644
--- a/store/sqlstore/upgrade.go
+++ b/store/sqlstore/upgrade.go
@@ -431,6 +431,19 @@ func UpgradeDatabaseToVersion50(sqlStore SqlStore) {
// 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()`.
+ // This version of Mattermost also includes a online-migration which migrates some roles from the `Roles` columns of
+ // TeamMember and ChannelMember rows to the new SchemeAdmin and SchemeUser columns. If you need to downgrade to a
+ // version of Mattermost prior to 5.0, you should take your server offline and run the following SQL statements
+ // prior to launching the downgraded version:
+ //
+ // UPDATE Teams SET SchemeId = NULL;
+ // UPDATE Channels SET SchemeId = NULL;
+ // UPDATE TeamMembers SET Roles = CONCAT(Roles, ' team_user'), SchemeUser = NULL where SchemeUser = 1;
+ // UPDATE TeamMembers SET Roles = CONCAT(Roles, ' team_admin'), SchemeAdmin = NULL where SchemeAdmin = 1;
+ // UPDATE ChannelMembers SET Roles = CONCAT(Roles, ' channel_user'), SchemeUser = NULL where SchemeUser = 1;
+ // UPDATE ChannelMembers SET Roles = CONCAT(Roles, ' channel_admin'), SchemeAdmin = NULL where SchemeAdmin = 1;
+ // DELETE from Systems WHERE Name = 'migration_advanced_permissions_phase_2';
+
if shouldPerformUpgrade(sqlStore, VERSION_4_10_0, VERSION_5_0_0) {
sqlStore.CreateColumnIfNotExistsNoDefault("Teams", "SchemeId", "varchar(26)", "varchar(26)")