Fix `UndefinedColumn: column "key_json" does not exist` errors when handling users with more than 50 non-E2E devices (#14580)

pull/14582/head
David Robertson 2022-11-29 13:05:07 +00:00 committed by GitHub
parent 8c5b8e6d40
commit e860316818
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

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