Commit a9d4c7d4 authored by Derrick Anderson's avatar Derrick Anderson

Merge branch 'mm-9633' into release-4.7

parents 93601319 291432e2
...@@ -6,7 +6,6 @@ package model ...@@ -6,7 +6,6 @@ package model
type ChannelMemberHistory struct { type ChannelMemberHistory struct {
ChannelId string ChannelId string
UserId string UserId string
UserEmail string `db:"Email"`
JoinTime int64 JoinTime int64
LeaveTime *int64 LeaveTime *int64
} }
...@@ -13,6 +13,7 @@ import ( ...@@ -13,6 +13,7 @@ import (
// It should be maitained in chronological order with most current // It should be maitained in chronological order with most current
// release at the front of the list. // release at the front of the list.
var versions = []string{ var versions = []string{
"4.7.1",
"4.7.0", "4.7.0",
"4.6.0", "4.6.0",
"4.5.0", "4.5.0",
......
...@@ -15,6 +15,7 @@ import ( ...@@ -15,6 +15,7 @@ import (
) )
const ( const (
VERSION_4_7_1 = "4.7.1"
VERSION_4_7_0 = "4.7.0" VERSION_4_7_0 = "4.7.0"
VERSION_4_6_0 = "4.6.0" VERSION_4_6_0 = "4.6.0"
VERSION_4_5_0 = "4.5.0" VERSION_4_5_0 = "4.5.0"
...@@ -64,6 +65,7 @@ func UpgradeDatabase(sqlStore SqlStore) { ...@@ -64,6 +65,7 @@ func UpgradeDatabase(sqlStore SqlStore) {
UpgradeDatabaseToVersion45(sqlStore) UpgradeDatabaseToVersion45(sqlStore)
UpgradeDatabaseToVersion46(sqlStore) UpgradeDatabaseToVersion46(sqlStore)
UpgradeDatabaseToVersion47(sqlStore) UpgradeDatabaseToVersion47(sqlStore)
UpgradeDatabaseToVersion471(sqlStore)
// If the SchemaVersion is empty this this is the first time it has ran // If the SchemaVersion is empty this this is the first time it has ran
// so lets set it to the current version. // so lets set it to the current version.
...@@ -349,3 +351,13 @@ func UpgradeDatabaseToVersion47(sqlStore SqlStore) { ...@@ -349,3 +351,13 @@ func UpgradeDatabaseToVersion47(sqlStore SqlStore) {
saveSchemaVersion(sqlStore, VERSION_4_7_0) 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)
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment