diff options
author | Erik Johnston <erik@matrix.org> | 2019-10-31 15:22:08 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-10-31 15:22:08 +0000 |
commit | 8f5bbdb987c92ee3e9b4170cc8ce296d87b1555d (patch) | |
tree | 6601b24b7170785a572e180100770a99362ed15f /synapse/storage/data_stores | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/split_purg... (diff) | |
download | synapse-8f5bbdb987c92ee3e9b4170cc8ce296d87b1555d.tar.xz |
Fix purge room API
Diffstat (limited to 'synapse/storage/data_stores')
-rw-r--r-- | synapse/storage/data_stores/main/events.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/synapse/storage/data_stores/main/events.py b/synapse/storage/data_stores/main/events.py index 63b09a09e8..a904a71570 100644 --- a/synapse/storage/data_stores/main/events.py +++ b/synapse/storage/data_stores/main/events.py @@ -1829,8 +1829,10 @@ class EventsStore( txn.execute( """ DELETE FROM state_groups_state - INNER JOIN state_groups USING (event_id) - WHEREE state_groups.room_id = ? + WHERE state_group IN ( + SELECT state_group FROM state_groups + WHERE room_id = ? + ) """, (room_id,), ) @@ -1841,8 +1843,9 @@ class EventsStore( txn.execute( """ DELETE FROM state_group_edges - INNER JOIN state_groups USING (event_id) - WHEREE state_groups.room_id = ? + WHERE state_group IN ( + SELECT state_group FROM state_groups + WHERE room_id = ? ) """, (room_id,), @@ -1853,7 +1856,7 @@ class EventsStore( txn.execute( """ - DELETE FROM state_groups WHEREE room_id = ? + DELETE FROM state_groups WHERE room_id = ? """, (room_id,), ) |