summaryrefslogtreecommitdiffstats
path: root/store/sqlstore
diff options
context:
space:
mode:
authorDerrick Anderson <derrick@andersonwebstudio.com>2018-02-19 17:07:39 -0500
committerDerrick Anderson <derrick@andersonwebstudio.com>2018-02-19 17:07:39 -0500
commit0145cd4da8c9c2401b8f3d5024ebe4608f7e8fd2 (patch)
tree38a28f98e4577de13a9fc81f56c7538d07b9e715 /store/sqlstore
parent30197584d5a215a3b25bffa79a034ed9e360cf52 (diff)
parentc39291597be9642e5dc200bdb0c3730d2b776c32 (diff)
downloadchat-0145cd4da8c9c2401b8f3d5024ebe4608f7e8fd2.tar.gz
chat-0145cd4da8c9c2401b8f3d5024ebe4608f7e8fd2.tar.bz2
chat-0145cd4da8c9c2401b8f3d5024ebe4608f7e8fd2.zip
Merge branch 'merge-4.7'
Diffstat (limited to 'store/sqlstore')
-rw-r--r--store/sqlstore/upgrade.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go
index 09f2c9160..77289183c 100644
--- a/store/sqlstore/upgrade.go
+++ b/store/sqlstore/upgrade.go
@@ -16,6 +16,7 @@ import (
const (
VERSION_4_8_0 = "4.8.0"
+ 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"
@@ -65,6 +66,7 @@ func UpgradeDatabase(sqlStore SqlStore) {
UpgradeDatabaseToVersion45(sqlStore)
UpgradeDatabaseToVersion46(sqlStore)
UpgradeDatabaseToVersion47(sqlStore)
+ UpgradeDatabaseToVersion471(sqlStore)
UpgradeDatabaseToVersion48(sqlStore)
// If the SchemaVersion is empty this this is the first time it has ran
@@ -352,6 +354,16 @@ func UpgradeDatabaseToVersion47(sqlStore SqlStore) {
}
}
+// 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)
+ }
+}
+
func UpgradeDatabaseToVersion48(sqlStore SqlStore) {
//TODO: Uncomment the following condition when version 4.8.0 is released
//if shouldPerformUpgrade(sqlStore, VERSION_4_7_0, VERSION_4_8_0) {