* set db to 4.9

* add prepatory code for 4.10

* bug from old example
Этот коммит содержится в:
Derrick Anderson
2018-04-05 11:45:55 -04:00
коммит произвёл GitHub
родитель 715a7f893d
Коммит f9015a37f3
2 изменённых файлов: 20 добавлений и 10 удалений

Просмотреть файл

@@ -13,6 +13,7 @@ import (
// It should be maintained in chronological order with most current // It should be maintained 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.9.0",
"4.8.1", "4.8.1",
"4.8.0", "4.8.0",
"4.7.2", "4.7.2",

Просмотреть файл

@@ -16,6 +16,7 @@ import (
) )
const ( const (
VERSION_4_10_0 = "4.10.0"
VERSION_4_9_0 = "4.9.0" VERSION_4_9_0 = "4.9.0"
VERSION_4_8_1 = "4.8.1" VERSION_4_8_1 = "4.8.1"
VERSION_4_8_0 = "4.8.0" VERSION_4_8_0 = "4.8.0"
@@ -75,6 +76,7 @@ func UpgradeDatabase(sqlStore SqlStore) {
UpgradeDatabaseToVersion48(sqlStore) UpgradeDatabaseToVersion48(sqlStore)
UpgradeDatabaseToVersion481(sqlStore) UpgradeDatabaseToVersion481(sqlStore)
UpgradeDatabaseToVersion49(sqlStore) UpgradeDatabaseToVersion49(sqlStore)
UpgradeDatabaseToVersion410(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.
@@ -396,8 +398,7 @@ func UpgradeDatabaseToVersion49(sqlStore SqlStore) {
// a number of parameters in `config.json` to a `Roles` table in the database. The migration code can be seen // 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()`. // 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) {
//if shouldPerformUpgrade(sqlStore, VERSION_4_8_1, VERSION_4_9_0) {
sqlStore.CreateColumnIfNotExists("Teams", "LastTeamIconUpdate", "bigint", "bigint", "0") sqlStore.CreateColumnIfNotExists("Teams", "LastTeamIconUpdate", "bigint", "bigint", "0")
defaultTimezone := model.DefaultUserTimezone() defaultTimezone := model.DefaultUserTimezone()
defaultTimezoneValue, err := json.Marshal(defaultTimezone) defaultTimezoneValue, err := json.Marshal(defaultTimezone)
@@ -406,6 +407,14 @@ func UpgradeDatabaseToVersion49(sqlStore SqlStore) {
} }
sqlStore.CreateColumnIfNotExists("Users", "Timezone", "varchar(256)", "varchar(256)", string(defaultTimezoneValue)) sqlStore.CreateColumnIfNotExists("Users", "Timezone", "varchar(256)", "varchar(256)", string(defaultTimezoneValue))
sqlStore.RemoveIndexIfExists("idx_channels_displayname", "Channels") sqlStore.RemoveIndexIfExists("idx_channels_displayname", "Channels")
// saveSchemaVersion(sqlStore, VERSION_4_9_0) 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)
//} //}
} }