Hotfix to allow .7 to be upgraded to 1.1
Этот коммит содержится в:
@@ -72,7 +72,14 @@ func NewSqlStore() Store {
|
|||||||
// Check to see if it's the most current database schema version
|
// Check to see if it's the most current database schema version
|
||||||
if !model.IsCurrentVersion(schemaVersion) {
|
if !model.IsCurrentVersion(schemaVersion) {
|
||||||
// If we are upgrading from the previous version then print a warning and continue
|
// If we are upgrading from the previous version then print a warning and continue
|
||||||
if model.IsPreviousVersion(schemaVersion) {
|
|
||||||
|
// Special case
|
||||||
|
isSchemaVersion07 := false
|
||||||
|
if schemaVersion == "0.7.1" || schemaVersion == "0.7.0" {
|
||||||
|
isSchemaVersion07 = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if model.IsPreviousVersion(schemaVersion) || isSchemaVersion07 {
|
||||||
l4g.Warn("The database schema version of " + schemaVersion + " appears to be out of date")
|
l4g.Warn("The database schema version of " + schemaVersion + " appears to be out of date")
|
||||||
l4g.Warn("Attempting to upgrade the database schema version to " + model.CurrentVersion)
|
l4g.Warn("Attempting to upgrade the database schema version to " + model.CurrentVersion)
|
||||||
} else {
|
} else {
|
||||||
@@ -84,6 +91,13 @@ func NewSqlStore() Store {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// REMOVE in 1.2
|
||||||
|
if sqlStore.DoesTableExist("Sessions") {
|
||||||
|
if sqlStore.DoesColumnExist("Sessions", "AltId") {
|
||||||
|
sqlStore.GetMaster().Exec("DROP TABLE IF EXISTS Sessions")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sqlStore.team = NewSqlTeamStore(sqlStore)
|
sqlStore.team = NewSqlTeamStore(sqlStore)
|
||||||
sqlStore.channel = NewSqlChannelStore(sqlStore)
|
sqlStore.channel = NewSqlChannelStore(sqlStore)
|
||||||
sqlStore.post = NewSqlPostStore(sqlStore)
|
sqlStore.post = NewSqlPostStore(sqlStore)
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ func NewSqlTeamStore(sqlStore *SqlStore) TeamStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlTeamStore) UpgradeSchemaIfNeeded() {
|
func (s SqlTeamStore) UpgradeSchemaIfNeeded() {
|
||||||
|
// REMOVE in 1.2
|
||||||
|
s.RemoveColumnIfExists("Teams", "AllowValet")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SqlTeamStore) CreateIndexesIfNotExists() {
|
func (s SqlTeamStore) CreateIndexesIfNotExists() {
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ func NewSqlUserStore(sqlStore *SqlStore) UserStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (us SqlUserStore) UpgradeSchemaIfNeeded() {
|
func (us SqlUserStore) UpgradeSchemaIfNeeded() {
|
||||||
|
// REMOVE in 1.2
|
||||||
|
us.CreateColumnIfNotExists("Users", "ThemeProps", "varchar(2000)", "character varying(2000)", "{}")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (us SqlUserStore) CreateIndexesIfNotExists() {
|
func (us SqlUserStore) CreateIndexesIfNotExists() {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user