summary refs log tree commit diff
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-13 15:07:00 +0100
committerOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-13 15:07:00 +0100
commitfd184f6cd07e2b31bdea221fff9b6baee6ef67c2 (patch)
tree1eaa828e73ac6079ffb97ae2a90953396a933781
parentFix stats tests and their expectations of the number of events in fresh (diff)
downloadsynapse-fd184f6cd07e2b31bdea221fff9b6baee6ef67c2.tar.xz
Fix generality of query
-rw-r--r--synapse/storage/schema/delta/56/stats_separated2.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/storage/schema/delta/56/stats_separated2.py b/synapse/storage/schema/delta/56/stats_separated2.py
index b92984a8cf..07b1d982ed 100644
--- a/synapse/storage/schema/delta/56/stats_separated2.py
+++ b/synapse/storage/schema/delta/56/stats_separated2.py
@@ -42,9 +42,9 @@ def _run_create_generic(stats_type, cursor, database_engine):
         cursor.execute(
             """
                 CREATE INDEX IF NOT EXISTS %s_stats_not_complete
-                    ON %s_stats_current (completed_delta_stream_id, room_id);
+                    ON %s_stats_current (completed_delta_stream_id, %s_id);
             """
-            % (stats_type, stats_type)
+            % (stats_type, stats_type, stats_type)
         )
     elif isinstance(database_engine, PostgresEngine):
         # This partial index helps us with finding dirty stats rows
@@ -60,10 +60,10 @@ def _run_create_generic(stats_type, cursor, database_engine):
         cursor.execute(
             """
                 CREATE INDEX IF NOT EXISTS %s_stats_not_complete
-                    ON %s_stats_current (room_id)
+                    ON %s_stats_current (%s_id)
                     WHERE completed_delta_stream_id IS NULL;
             """
-            % (stats_type, stats_type)
+            % (stats_type, stats_type, stats_type)
         )
     else:
         raise NotImplementedError("Unknown database engine.")