summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-11-29 13:05:07 +0000
committerGitHub <noreply@github.com>2022-11-29 13:05:07 +0000
commite860316818da4bd643d567708adb8d104f4a3351 (patch)
tree473935518f191599e50fa7162097b84981d2da53 /synapse/storage
parent1.73.0rc1 (diff)
downloadsynapse-e860316818da4bd643d567708adb8d104f4a3351.tar.xz
Fix `UndefinedColumn: column "key_json" does not exist` errors when handling users with more than 50 non-E2E devices (#14580)
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/databases/main/devices.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/devices.py b/synapse/storage/databases/main/devices.py
index 1e83c62753..0378035cff 100644
--- a/synapse/storage/databases/main/devices.py
+++ b/synapse/storage/databases/main/devices.py
@@ -1559,6 +1559,7 @@ class DeviceBackgroundUpdateStore(SQLBaseStore):
             # that ensures we keep at most 50 devices.
             sql = """
                 SELECT last_seen FROM devices
+                LEFT JOIN e2e_device_keys_json USING (user_id, device_id)
                 WHERE
                     user_id = ?
                     AND NOT hidden