summary refs log tree commit diff
path: root/synapse/storage/schema
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage/schema')
-rw-r--r--synapse/storage/schema/im.sql5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/storage/schema/im.sql b/synapse/storage/schema/im.sql
index 9a0f2145d5..2452890ea4 100644
--- a/synapse/storage/schema/im.sql
+++ b/synapse/storage/schema/im.sql
@@ -32,7 +32,10 @@ CREATE TABLE IF NOT EXISTS state_events(
 
 CREATE TABLE IF NOT EXISTS current_state_events(
     event_id TEXT NOT NULL,
-    room_id TEXT NOT NULL
+    room_id TEXT NOT NULL,
+    type TEXT NOT NULL,
+    state_key TEXT NOT NULL,
+    CONSTRAINT uniq UNIQUE (room_id, type, state_key) ON CONFLICT REPLACE
 );
 
 CREATE TABLE IF NOT EXISTS room_memberships(