summaryrefslogtreecommitdiffstats
path: root/store/sql_store.go
diff options
context:
space:
mode:
Diffstat (limited to 'store/sql_store.go')
-rw-r--r--store/sql_store.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/store/sql_store.go b/store/sql_store.go
index c0b3c2021..6ba73a0e5 100644
--- a/store/sql_store.go
+++ b/store/sql_store.go
@@ -56,6 +56,8 @@ func NewSqlStore() Store {
utils.Cfg.SqlSettings.Trace)
}
+ //version := sqlStore.GetCurrentSchemaVersion()
+
// Temporary upgrade code, remove after 0.8.0 release
if sqlStore.DoesColumnExist("Sessions", "AltId") {
sqlStore.GetMaster().Exec("DROP TABLE IF EXISTS Sessions")
@@ -131,6 +133,11 @@ func setupConnection(con_type string, driver string, dataSource string, maxIdle
return dbmap
}
+func (ss SqlStore) GetCurrentSchemaVersion() string {
+ version, _ := ss.GetMaster().SelectStr("SELECT PropVal FROM MattermostSystem WHERE PropName='SchemaVersion'")
+ return version
+}
+
func (ss SqlStore) DoesColumnExist(tableName string, columnName string) bool {
if utils.Cfg.SqlSettings.DriverName == "postgres" {
count, err := ss.GetMaster().SelectInt(