mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-27 04:09:24 -05:00
purge_history: fix index use
event_push_actions doesn't have an index on event_id, so we need to specify room_id.
This commit is contained in:
parent
5fcbf1e07c
commit
278d21b5e4
@ -2314,6 +2314,20 @@ class EventsStore(SQLBaseStore):
|
|||||||
")" % (table,),
|
")" % (table,),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# event_push_actions lacks an index on event_id, and has one on
|
||||||
|
# (room_id, event_id) instead.
|
||||||
|
for table in (
|
||||||
|
"event_push_actions",
|
||||||
|
):
|
||||||
|
logger.info("[purge] removing events from %s", table)
|
||||||
|
|
||||||
|
txn.execute(
|
||||||
|
"DELETE FROM %s WHERE room_id = ? AND event_id IN ("
|
||||||
|
" SELECT event_id FROM events_to_purge WHERE should_delete"
|
||||||
|
")" % (table,),
|
||||||
|
(room_id, )
|
||||||
|
)
|
||||||
|
|
||||||
# Mark all state and own events as outliers
|
# Mark all state and own events as outliers
|
||||||
logger.info("[purge] marking remaining events as outliers")
|
logger.info("[purge] marking remaining events as outliers")
|
||||||
txn.execute(
|
txn.execute(
|
||||||
|
Loading…
Reference in New Issue
Block a user