summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Eastwood <eric.eastwood@beta.gouv.fr>2024-07-31 19:00:55 -0500
committerEric Eastwood <eric.eastwood@beta.gouv.fr>2024-07-31 19:00:55 -0500
commit8392d6ac3b7ff4dd924758234f0d7eeaecc3ce8f (patch)
tree129c3e4b2e741ba6c4b4521e144a1e082272aeef
parentAdd changelog (diff)
downloadsynapse-8392d6ac3b7ff4dd924758234f0d7eeaecc3ce8f.tar.xz
Use foreign keys
-rw-r--r--synapse/storage/schema/main/delta/87/01_sliding_sync_memberships.sql6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/schema/main/delta/87/01_sliding_sync_memberships.sql b/synapse/storage/schema/main/delta/87/01_sliding_sync_memberships.sql
index cd211bad92..646d3b7128 100644
--- a/synapse/storage/schema/main/delta/87/01_sliding_sync_memberships.sql
+++ b/synapse/storage/schema/main/delta/87/01_sliding_sync_memberships.sql
@@ -12,7 +12,7 @@
 -- <https://www.gnu.org/licenses/agpl-3.0.html>.
 
 CREATE TABLE IF NOT EXISTS sliding_sync_joined_rooms(
-    room_id TEXT NOT NULL REFERENCES rooms(room_id),
+    FOREIGN KEY(room_id) REFERENCES rooms(room_id),
     room_type TEXT,
     room_name TEXT,
     is_encrypted BOOLEAN,
@@ -23,8 +23,8 @@ CREATE TABLE IF NOT EXISTS sliding_sync_joined_rooms(
 CREATE UNIQUE INDEX IF NOT EXISTS sliding_sync_joined_rooms_room_id ON sliding_sync_joined_rooms(room_id);
 
 CREATE TABLE IF NOT EXISTS sliding_sync_non_join_memberships(
-    membership_event_id TEXT NOT NULL REFERENCES events(event_id),
-    room_id TEXT NOT NULL REFERENCES rooms(room_id),
+    FOREIGN KEY(membership_event_id) REFERENCES events(event_id),
+    FOREIGN KEY(room_id) REFERENCES rooms(room_id),
     room_type TEXT,
     room_name TEXT,
     is_encrypted BOOLEAN,