summaryrefslogtreecommitdiffstats
path: root/store/sql_store.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-10-20 04:49:42 -0700
committer=Corey Hulen <corey@hulen.com>2015-10-20 04:49:42 -0700
commit437efdaaaa102f53f4ed8630d5d85645cfd06999 (patch)
tree8d704cd24e9676c3b7a60258a52ed55c0fb9e7e1 /store/sql_store.go
parente0d2ee3ccee80af95e1191f630802ff3fc1d55e5 (diff)
downloadchat-437efdaaaa102f53f4ed8630d5d85645cfd06999.tar.gz
chat-437efdaaaa102f53f4ed8630d5d85645cfd06999.tar.bz2
chat-437efdaaaa102f53f4ed8630d5d85645cfd06999.zip
Hotfix to allow .7 to be upgraded to 1.1
Diffstat (limited to 'store/sql_store.go')
-rw-r--r--store/sql_store.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/store/sql_store.go b/store/sql_store.go
index 900543460..3d10772d9 100644
--- a/store/sql_store.go
+++ b/store/sql_store.go
@@ -72,7 +72,14 @@ func NewSqlStore() Store {
// 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
- 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("Attempting to upgrade the database schema version to " + model.CurrentVersion)
} 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.channel = NewSqlChannelStore(sqlStore)
sqlStore.post = NewSqlPostStore(sqlStore)