mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-22 04:34:28 +03:00
PostgreSQL, Y U no like?
This commit is contained in:
parent
185188be03
commit
430ea08186
1 changed files with 4 additions and 3 deletions
|
@ -603,9 +603,9 @@ class DeviceStore(DeviceWorkerStore, BackgroundUpdateStore):
|
||||||
"""
|
"""
|
||||||
sql = """
|
sql = """
|
||||||
DELETE FROM devices
|
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))
|
self.device_id_exists_cache.invalidate((user_id, device_id))
|
||||||
|
|
||||||
|
@ -624,12 +624,13 @@ class DeviceStore(DeviceWorkerStore, BackgroundUpdateStore):
|
||||||
return
|
return
|
||||||
sql = """
|
sql = """
|
||||||
DELETE FROM devices
|
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)
|
",".join("?" for _ in device_ids)
|
||||||
)
|
)
|
||||||
values = [user_id]
|
values = [user_id]
|
||||||
values.extend(device_ids)
|
values.extend(device_ids)
|
||||||
|
values.append(False)
|
||||||
|
|
||||||
yield self._execute("delete_devices", None, sql, *values)
|
yield self._execute("delete_devices", None, sql, *values)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue