summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-07-20 16:16:43 +0100
committerGitHub <noreply@github.com>2017-07-20 16:16:43 +0100
commitb27429729d7591313107926bf5b0a180c2f07837 (patch)
treeb297766fcf14bd8208d7769b7449a32126ffc02b
parentMerge pull request #2371 from matrix-org/erikj/push_cache_hit (diff)
parentExtend comment (diff)
downloadsynapse-b27429729d7591313107926bf5b0a180c2f07837.tar.xz
Merge pull request #2375 from matrix-org/erikj/port_script
Fix port script for user directory tables
-rwxr-xr-xscripts/synapse_port_db19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/synapse_port_db b/scripts/synapse_port_db
index 7d158a46a4..bc167b59af 100755
--- a/scripts/synapse_port_db
+++ b/scripts/synapse_port_db
@@ -252,6 +252,25 @@ class Porter(object):
             )
             return
 
+        if table in (
+            "user_directory", "user_directory_search", "users_who_share_rooms",
+            "users_in_pubic_room",
+        ):
+            # We don't port these tables, as they're a faff and we can regenreate
+            # them anyway.
+            self.progress.update(table, table_size)  # Mark table as done
+            return
+
+        if table == "user_directory_stream_pos":
+            # We need to make sure there is a single row, `(X, null), as that is
+            # what synapse expects to be there.
+            yield self.postgres_store._simple_insert(
+                table=table,
+                values={"stream_id": None},
+            )
+            self.progress.update(table, table_size)  # Mark table as done
+            return
+
         forward_select = (
             "SELECT rowid, * FROM %s WHERE rowid >= ? ORDER BY rowid LIMIT ?"
             % (table,)