diff options
author | =Corey Hulen <corey@hulen.com> | 2015-09-16 17:37:11 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-09-16 17:37:11 -0700 |
commit | cef7a1aae4205ebf4fbd8958f1f870ff69759edf (patch) | |
tree | a3bbd45979a89f9a4030f750b1a30099d7e565b9 /store/sql_store.go | |
parent | e644b53b72d346539f5c58cc0cb0a07c4054cbcb (diff) | |
download | chat-cef7a1aae4205ebf4fbd8958f1f870ff69759edf.tar.gz chat-cef7a1aae4205ebf4fbd8958f1f870ff69759edf.tar.bz2 chat-cef7a1aae4205ebf4fbd8958f1f870ff69759edf.zip |
PLT-92 Adding server side versioning to the binary
Diffstat (limited to 'store/sql_store.go')
-rw-r--r-- | store/sql_store.go | 7 |
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( |