diff options
author | Hubert Chathi <hubert@uhoreg.ca> | 2019-07-31 15:38:11 -0400 |
---|---|---|
committer | Hubert Chathi <hubert@uhoreg.ca> | 2019-07-31 15:38:11 -0400 |
commit | 430ea08186750ef67899bc302c0b6bb32c2f111c (patch) | |
tree | 5c004195d7fb039fc088fa4cf28c93aeda32fb86 /synapse | |
parent | remove extra SQL query param (diff) | |
download | synapse-430ea08186750ef67899bc302c0b6bb32c2f111c.tar.xz |
PostgreSQL, Y U no like?
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/storage/devices.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/storage/devices.py b/synapse/storage/devices.py index b3e8c7396d..a1f12df907 100644 --- a/synapse/storage/devices.py +++ b/synapse/storage/devices.py @@ -603,9 +603,9 @@ class DeviceStore(DeviceWorkerStore, BackgroundUpdateStore): """ sql = """ DELETE FROM devices - WHERE user_id = ? AND device_id = ? AND NOT hidden + WHERE user_id = ? AND device_id = ? AND hidden = ? """ - yield self._execute("delete_device", None, sql, user_id, device_id) + yield self._execute("delete_device", None, sql, user_id, device_id, False) self.device_id_exists_cache.invalidate((user_id, device_id)) @@ -624,12 +624,13 @@ class DeviceStore(DeviceWorkerStore, BackgroundUpdateStore): return sql = """ DELETE FROM devices - WHERE user_id = ? AND device_id IN (%s) AND NOT hidden + WHERE user_id = ? AND device_id IN (%s) AND hidden = ? """ % ( ",".join("?" for _ in device_ids) ) values = [user_id] values.extend(device_ids) + values.append(False) yield self._execute("delete_devices", None, sql, *values) |