diff options
author | JoramWilander <jwawilander@gmail.com> | 2018-02-16 17:14:22 -0500 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2018-02-16 17:14:22 -0500 |
commit | 291432e2549d7f36c3c39336d925b036c0ef5de4 (patch) | |
tree | 4970b45b06c33914ed02a54787fd431df921547f | |
parent | 98bd9a07538891d3ee9aded8865b4454cf72ea32 (diff) | |
download | chat-291432e2549d7f36c3c39336d925b036c0ef5de4.tar.gz chat-291432e2549d7f36c3c39336d925b036c0ef5de4.tar.bz2 chat-291432e2549d7f36c3c39336d925b036c0ef5de4.zip |
Add upgrade code from 4.7.0 to 4.7.1
-rw-r--r-- | model/version.go | 1 | ||||
-rw-r--r-- | store/sqlstore/upgrade.go | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/model/version.go b/model/version.go index 1bd7baecc..6e461e5d5 100644 --- a/model/version.go +++ b/model/version.go @@ -13,6 +13,7 @@ import ( // It should be maitained in chronological order with most current // release at the front of the list. var versions = []string{ + "4.7.1", "4.7.0", "4.6.0", "4.5.0", diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go index 75286d214..25c9e067a 100644 --- a/store/sqlstore/upgrade.go +++ b/store/sqlstore/upgrade.go @@ -15,6 +15,7 @@ import ( ) const ( + VERSION_4_7_1 = "4.7.1" VERSION_4_7_0 = "4.7.0" VERSION_4_6_0 = "4.6.0" VERSION_4_5_0 = "4.5.0" @@ -64,6 +65,7 @@ func UpgradeDatabase(sqlStore SqlStore) { UpgradeDatabaseToVersion45(sqlStore) UpgradeDatabaseToVersion46(sqlStore) UpgradeDatabaseToVersion47(sqlStore) + UpgradeDatabaseToVersion471(sqlStore) // If the SchemaVersion is empty this this is the first time it has ran // so lets set it to the current version. @@ -349,3 +351,13 @@ func UpgradeDatabaseToVersion47(sqlStore SqlStore) { saveSchemaVersion(sqlStore, VERSION_4_7_0) } } + +// If any new instances started with 4.7, they would have the bad Email column on the +// ChannelMemberHistory table. So for those cases we need to do an upgrade between +// 4.7.0 and 4.7.1 +func UpgradeDatabaseToVersion471(sqlStore SqlStore) { + if shouldPerformUpgrade(sqlStore, VERSION_4_7_0, VERSION_4_7_1) { + sqlStore.RemoveColumnIfExists("ChannelMemberHistory", "Email") + saveSchemaVersion(sqlStore, VERSION_4_7_1) + } +} |