diff options
author | =Corey Hulen <corey@hulen.com> | 2016-01-28 11:39:48 -0500 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-01-28 11:39:48 -0500 |
commit | 2138b46f6cdab5fca49680c2e1994703ab71b1c3 (patch) | |
tree | d143d3dc67122019d96d135ae5f2fe39b79ace7c /store/sql_store.go | |
parent | fa6daad64d474e99f3a2964784585a748350c25a (diff) | |
download | chat-2138b46f6cdab5fca49680c2e1994703ab71b1c3.tar.gz chat-2138b46f6cdab5fca49680c2e1994703ab71b1c3.tar.bz2 chat-2138b46f6cdab5fca49680c2e1994703ab71b1c3.zip |
PLT-1765 allowing support of 2 previous versions
Diffstat (limited to 'store/sql_store.go')
-rw-r--r-- | store/sql_store.go | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/store/sql_store.go b/store/sql_store.go index e4e1bf3b4..335cb207c 100644 --- a/store/sql_store.go +++ b/store/sql_store.go @@ -73,25 +73,13 @@ func NewSqlStore() Store { } schemaVersion := sqlStore.GetCurrentSchemaVersion() - isSchemaVersion07 := false // REMOVE AFTER 1.2 SHIP see PLT-828 - isSchemaVersion10 := false // REMOVE AFTER 1.2 SHIP see PLT-828 // If the version is already set then we are potentially in an 'upgrade needed' state if schemaVersion != "" { // Check to see if it's the most current database schema version if !model.IsCurrentVersion(schemaVersion) { // If we are upgrading from the previous version then print a warning and continue - - // Special case - if schemaVersion == "0.7.1" || schemaVersion == "0.7.0" { - isSchemaVersion07 = true - } - - if schemaVersion == "1.0.0" { - isSchemaVersion10 = true - } - - if model.IsPreviousVersion(schemaVersion) || isSchemaVersion07 || isSchemaVersion10 { + if model.IsPreviousVersionsSupported(schemaVersion) { l4g.Warn(utils.T("store.sql.schema_out_of_date.warn"), schemaVersion) l4g.Warn(utils.T("store.sql.schema_upgrade_attempt.warn"), model.CurrentVersion) } else { @@ -103,13 +91,6 @@ func NewSqlStore() Store { } } - // REMOVE AFTER 1.2 SHIP see PLT-828 - if sqlStore.DoesTableExist("Sessions") { - if sqlStore.DoesColumnExist("Sessions", "AltId") { - sqlStore.GetMaster().Exec("DROP TABLE IF EXISTS Sessions") - } - } - sqlStore.team = NewSqlTeamStore(sqlStore) sqlStore.channel = NewSqlChannelStore(sqlStore) sqlStore.post = NewSqlPostStore(sqlStore) @@ -150,7 +131,7 @@ func NewSqlStore() Store { sqlStore.preference.(*SqlPreferenceStore).DeleteUnusedFeatures() - if model.IsPreviousVersion(schemaVersion) || isSchemaVersion07 || isSchemaVersion10 { + if model.IsPreviousVersionsSupported(schemaVersion) { sqlStore.system.Update(&model.System{Name: "Version", Value: model.CurrentVersion}) l4g.Warn(utils.T("store.sql.upgraded.warn"), model.CurrentVersion) } |