summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerrick Anderson <derrick@andersonwebstudio.com>2018-04-05 11:45:55 -0400
committerGitHub <noreply@github.com>2018-04-05 11:45:55 -0400
commitf9015a37f3f3ffe9dac9d3c3a44c7795b8b8b8b0 (patch)
tree4a8a94e7a27970717e57c4c1d806761577ebd953
parent715a7f893dc4a855083331333629cb50528a030d (diff)
downloadchat-f9015a37f3f3ffe9dac9d3c3a44c7795b8b8b8b0.tar.gz
chat-f9015a37f3f3ffe9dac9d3c3a44c7795b8b8b8b0.tar.bz2
chat-f9015a37f3f3ffe9dac9d3c3a44c7795b8b8b8b0.zip
uncomment 4.9 upgrade code (#8582)
* set db to 4.9 * add prepatory code for 4.10 * bug from old example
-rw-r--r--model/version.go1
-rw-r--r--store/sqlstore/upgrade.go29
2 files changed, 20 insertions, 10 deletions
diff --git a/model/version.go b/model/version.go
index 38ace0bde..a58ca4df6 100644
--- a/model/version.go
+++ b/model/version.go
@@ -13,6 +13,7 @@ import (
// It should be maintained in chronological order with most current
// release at the front of the list.
var versions = []string{
+ "4.9.0",
"4.8.1",
"4.8.0",
"4.7.2",
diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go
index 89c6e3d07..882ee48ba 100644
--- a/store/sqlstore/upgrade.go
+++ b/store/sqlstore/upgrade.go
@@ -16,6 +16,7 @@ import (
)
const (
+ VERSION_4_10_0 = "4.10.0"
VERSION_4_9_0 = "4.9.0"
VERSION_4_8_1 = "4.8.1"
VERSION_4_8_0 = "4.8.0"
@@ -75,6 +76,7 @@ func UpgradeDatabase(sqlStore SqlStore) {
UpgradeDatabaseToVersion48(sqlStore)
UpgradeDatabaseToVersion481(sqlStore)
UpgradeDatabaseToVersion49(sqlStore)
+ UpgradeDatabaseToVersion410(sqlStore)
// If the SchemaVersion is empty this this is the first time it has ran
// so lets set it to the current version.
@@ -396,16 +398,23 @@ func UpgradeDatabaseToVersion49(sqlStore SqlStore) {
// a number of parameters in `config.json` to a `Roles` table in the database. The migration code can be seen
// in the file `app/app.go` in the function `DoAdvancedPermissionsMigration()`.
- //TODO: Uncomment the following condition when version 4.9.0 is released
- //if shouldPerformUpgrade(sqlStore, VERSION_4_8_1, VERSION_4_9_0) {
- sqlStore.CreateColumnIfNotExists("Teams", "LastTeamIconUpdate", "bigint", "bigint", "0")
- defaultTimezone := model.DefaultUserTimezone()
- defaultTimezoneValue, err := json.Marshal(defaultTimezone)
- if err != nil {
- l4g.Critical(err)
+ if shouldPerformUpgrade(sqlStore, VERSION_4_8_1, VERSION_4_9_0) {
+ sqlStore.CreateColumnIfNotExists("Teams", "LastTeamIconUpdate", "bigint", "bigint", "0")
+ defaultTimezone := model.DefaultUserTimezone()
+ defaultTimezoneValue, err := json.Marshal(defaultTimezone)
+ if err != nil {
+ l4g.Critical(err)
+ }
+ sqlStore.CreateColumnIfNotExists("Users", "Timezone", "varchar(256)", "varchar(256)", string(defaultTimezoneValue))
+ sqlStore.RemoveIndexIfExists("idx_channels_displayname", "Channels")
+ saveSchemaVersion(sqlStore, VERSION_4_9_0)
}
- sqlStore.CreateColumnIfNotExists("Users", "Timezone", "varchar(256)", "varchar(256)", string(defaultTimezoneValue))
- sqlStore.RemoveIndexIfExists("idx_channels_displayname", "Channels")
- // saveSchemaVersion(sqlStore, VERSION_4_9_0)
+}
+
+func UpgradeDatabaseToVersion410(sqlStore SqlStore) {
+ // TODO: Uncomment following condition when version 4.10.0 is released
+ //if shouldPerformUpgrade(sqlStore, VERSION_4_9_0, VERSION_4_10_0) {
+
+ // saveSchemaVersion(sqlStore, VERSION_4_10_0)
//}
}