summary refs log tree commit diff
path: root/synapse/storage/databases/main
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2023-07-10 16:24:42 +0100
committerGitHub <noreply@github.com>2023-07-10 16:24:42 +0100
commite55a9b3e41e73f34fda781b9374935c4623f7ea9 (patch)
tree6cfa8859ae42ed28cf12470586cd3a7539e1da5f /synapse/storage/databases/main
parentFix building rust with nightly (#15906) (diff)
downloadsynapse-e55a9b3e41e73f34fda781b9374935c4623f7ea9.tar.xz
Fix downgrading to previous version of Synapse (#15907)
We do this by marking the constraint as deferrable.
Diffstat (limited to 'synapse/storage/databases/main')
-rw-r--r--synapse/storage/databases/main/event_federation.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/storage/databases/main/event_federation.py b/synapse/storage/databases/main/event_federation.py
index dabe603c8c..b2cda52ce5 100644
--- a/synapse/storage/databases/main/event_federation.py
+++ b/synapse/storage/databases/main/event_federation.py
@@ -146,7 +146,9 @@ class EventFederationWorkerStore(SignatureWorkerStore, EventsWorkerStore, SQLBas
                 update_name="event_forward_extremities_event_id_foreign_key_constraint_update",
                 table="event_forward_extremities",
                 constraint_name="event_forward_extremities_event_id",
-                constraint=ForeignKeyConstraint("events", [("event_id", "event_id")]),
+                constraint=ForeignKeyConstraint(
+                    "events", [("event_id", "event_id")], deferred=True
+                ),
                 unique_columns=("event_id", "room_id"),
             )