summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <lightportal@gmail.com>2014-08-24 11:28:03 +0100
committerErik Johnston <lightportal@gmail.com>2014-08-24 11:29:29 +0100
commit9d86c8c7a68fdbfa49df8bb027a112158df40bb8 (patch)
treeddd9a624d90101291369778483f78c70e9fc26ad /synapse
parentEncode unicode from json as utf-8. This was required to allow people to regis... (diff)
downloadsynapse-9d86c8c7a68fdbfa49df8bb027a112158df40bb8.tar.xz
Add a unique constraint on the room hosts table
Diffstat (limited to '')
-rw-r--r--synapse/storage/schema/im.sql3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/schema/im.sql b/synapse/storage/schema/im.sql
index 7f4e758892..e92f21ef3b 100644
--- a/synapse/storage/schema/im.sql
+++ b/synapse/storage/schema/im.sql
@@ -98,5 +98,6 @@ CREATE TABLE IF NOT EXISTS rooms(
 
 CREATE TABLE IF NOT EXISTS room_hosts(
     room_id TEXT NOT NULL,
-    host TEXT NOT NULL
+    host TEXT NOT NULL,
+    CONSTRAINT room_hosts_uniq UNIQUE (room_id, host) ON CONFLICT IGNORE
 );