diff options
author | JoramWilander <jwawilander@gmail.com> | 2018-07-07 12:04:18 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2018-07-07 12:04:18 -0400 |
commit | b78b216a3c8eb354085f97f33dac5e7661ac9188 (patch) | |
tree | dc7a253730a684bc6744c0b0bf36a87944242583 /store | |
parent | 359f12db33d45b6ffade0872ddf3652a5c52f4a8 (diff) | |
parent | 9e5ec7d09d4c51e278f17f25fb6c0f3484b50a3b (diff) | |
download | chat-b78b216a3c8eb354085f97f33dac5e7661ac9188.tar.gz chat-b78b216a3c8eb354085f97f33dac5e7661ac9188.tar.bz2 chat-b78b216a3c8eb354085f97f33dac5e7661ac9188.zip |
Merge branch 'master' into plugins-2
Diffstat (limited to 'store')
-rw-r--r-- | store/sqlstore/compliance_store.go | 1 | ||||
-rw-r--r-- | store/sqlstore/upgrade.go | 21 |
2 files changed, 17 insertions, 5 deletions
diff --git a/store/sqlstore/compliance_store.go b/store/sqlstore/compliance_store.go index 52bdee693..3dabffaab 100644 --- a/store/sqlstore/compliance_store.go +++ b/store/sqlstore/compliance_store.go @@ -224,6 +224,7 @@ func (s SqlComplianceStore) MessageExport(after int64, limit int) store.StoreCha Posts.Message AS PostMessage, Posts.Type AS PostType, Posts.OriginalId AS PostOriginalId, + Posts.RootId AS PostRootId, Posts.FileIds AS PostFileIds, Teams.Id AS TeamId, Teams.Name AS TeamName, diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go index fc2d53235..868575522 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)") @@ -453,9 +466,7 @@ func UpgradeDatabaseToVersion50(sqlStore SqlStore) { } func UpgradeDatabaseToVersion51(sqlStore SqlStore) { - // TODO: Uncomment following condition when version 5.1.0 is released - // if shouldPerformUpgrade(sqlStore, VERSION_5_0_0, VERSION_5_1_0) { - - // saveSchemaVersion(sqlStore, VERSION_5_1_0) - // } + if shouldPerformUpgrade(sqlStore, VERSION_5_0_0, VERSION_5_1_0) { + saveSchemaVersion(sqlStore, VERSION_5_1_0) + } } |