summaryrefslogtreecommitdiffstats
path: root/store/sqlstore/preference_store.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-09 10:16:14 -0700
committerJoram Wilander <jwawilander@gmail.com>2017-10-09 13:16:14 -0400
commit0f66b6e72621842467d0e368b95ee58f485d4ace (patch)
tree444f9210a151cb735fe0502d4bb47c324592c0e6 /store/sqlstore/preference_store.go
parent70e5f00241473c27a3008959ce08832c75e76ba8 (diff)
downloadchat-0f66b6e72621842467d0e368b95ee58f485d4ace.tar.gz
chat-0f66b6e72621842467d0e368b95ee58f485d4ace.tar.bz2
chat-0f66b6e72621842467d0e368b95ee58f485d4ace.zip
store/sqlstore cleanup and postgres tests (#7595)
* sqlstore cleanup / postgres tests * remove stopped containers * cmd/platform compile fix * remove test-postgres target from makefile
Diffstat (limited to 'store/sqlstore/preference_store.go')
-rw-r--r--store/sqlstore/preference_store.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/store/sqlstore/preference_store.go b/store/sqlstore/preference_store.go
index ddd1fc268..a97c3aea7 100644
--- a/store/sqlstore/preference_store.go
+++ b/store/sqlstore/preference_store.go
@@ -101,7 +101,7 @@ func (s SqlPreferenceStore) save(transaction *gorp.Transaction, preference *mode
"Value": preference.Value,
}
- if *utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_MYSQL {
+ if s.DriverName() == model.DATABASE_DRIVER_MYSQL {
if _, err := transaction.Exec(
`INSERT INTO
Preferences
@@ -112,7 +112,7 @@ func (s SqlPreferenceStore) save(transaction *gorp.Transaction, preference *mode
Value = :Value`, params); err != nil {
result.Err = model.NewAppError("SqlPreferenceStore.save", "store.sql_preference.save.updating.app_error", nil, err.Error(), http.StatusInternalServerError)
}
- } else if *utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_POSTGRES {
+ } else if s.DriverName() == model.DATABASE_DRIVER_POSTGRES {
// postgres has no way to upsert values until version 9.5 and trying inserting and then updating causes transactions to abort
count, err := transaction.SelectInt(
`SELECT