summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-12-29 16:54:03 +0000
committerErik Johnston <erik@matrix.org>2018-02-15 09:51:09 +0000
commit328bd35e00a081ca986e3c0532a01f8c2e17ed8a (patch)
tree621e791ae7557fcfc19a899f751e31799a874213
parentDisable auto search for prefixes in event search (diff)
downloadsynapse-328bd35e00a081ca986e3c0532a01f8c2e17ed8a.tar.xz
Deleting from event_push_actions needs to use an index
-rw-r--r--synapse/storage/events.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 28cce2979c..16c97c4b09 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -1043,7 +1043,6 @@ class EventsStore(SQLBaseStore):
                 "event_edge_hashes",
                 "event_edges",
                 "event_forward_extremities",
-                "event_push_actions",
                 "event_reference_hashes",
                 "event_search",
                 "event_signatures",
@@ -1063,6 +1062,14 @@ class EventsStore(SQLBaseStore):
                 [(ev.event_id,) for ev, _ in events_and_contexts]
             )
 
+        for table in (
+            "event_push_actions",
+        ):
+            txn.executemany(
+                "DELETE FROM %s WHERE room_id = ? AND event_id = ?" % (table,),
+                [(ev.event_id,) for ev, _ in events_and_contexts]
+            )
+
     def _store_event_txn(self, txn, events_and_contexts):
         """Insert new events into the event and event_json tables