uncomment 4.9 upgrade code (#8582)
* set db to 4.9 * add prepatory code for 4.10 * bug from old example
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
715a7f893d
Коммит
f9015a37f3
@@ -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,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
|
// 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)
|
if err != nil {
|
||||||
if err != nil {
|
l4g.Critical(err)
|
||||||
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)
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user