store/sqlstore cleanup and postgres tests (#7595)

* sqlstore cleanup / postgres tests

* remove stopped containers

* cmd/platform compile fix

* remove test-postgres target from makefile
Этот коммит содержится в:
Chris
2017-10-09 10:16:14 -07:00
коммит произвёл Joram Wilander
родитель 70e5f00241
Коммит 0f66b6e726
22 изменённых файлов: 334 добавлений и 119 удалений

Просмотреть файл

@@ -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