Remove from the event_relations table when purging historical events. (#7978)

This commit is contained in:
Patrick Cloke 2020-07-29 13:55:01 -04:00 committed by GitHub
parent 3a00bd1378
commit d90087cffa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

1
changelog.d/7978.bugfix Normal file
View file

@ -0,0 +1 @@
Fix a long standing bug: 'Duplicate key value violates unique constraint "event_relations_id"' when message retention is configured.

View file

@ -62,6 +62,7 @@ class PurgeEventsStore(StateGroupWorkerStore, SQLBaseStore):
# event_json # event_json
# event_push_actions # event_push_actions
# event_reference_hashes # event_reference_hashes
# event_relations
# event_search # event_search
# event_to_state_groups # event_to_state_groups
# events # events
@ -209,6 +210,7 @@ class PurgeEventsStore(StateGroupWorkerStore, SQLBaseStore):
"event_edges", "event_edges",
"event_forward_extremities", "event_forward_extremities",
"event_reference_hashes", "event_reference_hashes",
"event_relations",
"event_search", "event_search",
"rejections", "rejections",
): ):