summary refs log tree commit diff
path: root/synapse/storage/schema/delta
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-06-01 14:50:46 +0100
committerErik Johnston <erik@matrix.org>2017-06-01 14:50:46 +0100
commit21e255a8f1948c2fd298ce2e037d20bdd25f2f69 (patch)
tree0ceb691fc5430e046327fb4ba7398474b7c1457d /synapse/storage/schema/delta
parentTweak search query (diff)
downloadsynapse-21e255a8f1948c2fd298ce2e037d20bdd25f2f69.tar.xz
Split the table in two
Diffstat (limited to 'synapse/storage/schema/delta')
-rw-r--r--synapse/storage/schema/delta/42/user_dir.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/storage/schema/delta/42/user_dir.py b/synapse/storage/schema/delta/42/user_dir.py
index c34aa5e7d2..ea6a18196d 100644
--- a/synapse/storage/schema/delta/42/user_dir.py
+++ b/synapse/storage/schema/delta/42/user_dir.py
@@ -31,13 +31,21 @@ INSERT INTO user_directory_stream_pos (stream_id) VALUES (null);
 
 CREATE TABLE user_directory (
     user_id TEXT NOT NULL,
-    room_id TEXT NOT NULL,  -- A room_id that we know is public
+    room_id TEXT NOT NULL,  -- A room_id that we know the user is joined to
     display_name TEXT,
     avatar_url TEXT
 );
 
 CREATE INDEX user_directory_room_idx ON user_directory(room_id);
 CREATE UNIQUE INDEX user_directory_user_idx ON user_directory(user_id);
+
+CREATE TABLE users_in_pubic_room (
+    user_id TEXT NOT NULL,
+    room_id TEXT NOT NULL  -- A room_id that we know is public
+);
+
+CREATE INDEX users_in_pubic_room_room_idx ON users_in_pubic_room(room_id);
+CREATE UNIQUE INDEX users_in_pubic_room_user_idx ON users_in_pubic_room(user_id);
 """