summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-27 14:24:25 +0100
committerOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-27 14:24:25 +0100
commit11c4e506bd6254fcb9551729e70b7ade80b127e4 (patch)
treef3c34469618e9e4ec1d26ffb9441f6ce79f9c953 /synapse
parentRemove obsolete `OldCollectionRequired` as old collection is obsolete. (diff)
downloadsynapse-11c4e506bd6254fcb9551729e70b7ade80b127e4.tar.xz
Rename `room_state` table to `room_stats_state`
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/events.py2
-rw-r--r--synapse/storage/schema/delta/56/stats_separated1.sql3
-rw-r--r--synapse/storage/stats.py2
3 files changed, 5 insertions, 2 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 5a95c36a8b..28fdba5fb2 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -2270,7 +2270,7 @@ class EventsStore(
             "room_aliases",
             "room_depth",
             "room_memberships",
-            "room_state",
+            "room_stats_state",
             "room_stats",
             "room_stats_earliest_token",
             "rooms",
diff --git a/synapse/storage/schema/delta/56/stats_separated1.sql b/synapse/storage/schema/delta/56/stats_separated1.sql
index 045b5ca013..52fb09c0e6 100644
--- a/synapse/storage/schema/delta/56/stats_separated1.sql
+++ b/synapse/storage/schema/delta/56/stats_separated1.sql
@@ -137,3 +137,6 @@ CREATE INDEX IF NOT EXISTS user_stats_historical_end_ts ON user_stats_historical
 
 -- We don't need an index on (user_id, end_ts) because PRIMARY KEY sorts that
 -- out for us. (We would want it to review stats for a particular user.)
+
+-- Also rename room_state to room_stats_state to make its ownership clear.
+ALTER TABLE room_state RENAME TO room_stats_state;
diff --git a/synapse/storage/stats.py b/synapse/storage/stats.py
index 824e57bad7..fce0fb5a56 100644
--- a/synapse/storage/stats.py
+++ b/synapse/storage/stats.py
@@ -92,7 +92,7 @@ class StatsStore(StateDeltasStore):
                 fields[col] = None
 
         return self._simple_upsert(
-            table="room_state",
+            table="room_stats_state",
             keyvalues={"room_id": room_id},
             values=fields,
             desc="update_room_state",