Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 86e7a6d

Browse files
authored
Stop populating state_events.prev_state (#11558)
this field is never read, so we may as well stop populating it.
1 parent 9562f0c commit 86e7a6d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

changelog.d/11558.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Stop populating unused database column `state_events.prev_state`.

synapse/storage/databases/main/events.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,10 +1410,6 @@ def event_dict(event):
14101410
"state_key": event.state_key,
14111411
}
14121412

1413-
# TODO: How does this work with backfilling?
1414-
if hasattr(event, "replaces_state"):
1415-
vals["prev_state"] = event.replaces_state
1416-
14171413
state_values.append(vals)
14181414

14191415
self.db_pool.simple_insert_many_txn(

synapse/storage/schema/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
SCHEMA_VERSION = 66 # remember to update the list below when updating
15+
SCHEMA_VERSION = 67 # remember to update the list below when updating
1616
"""Represents the expectations made by the codebase about the database schema
1717
1818
This should be incremented whenever the codebase changes its requirements on the
@@ -50,6 +50,9 @@
5050
Changes in SCHEMA_VERSION = 66:
5151
- Queries on state_key columns are now disambiguated (ie, the codebase can handle
5252
the `events` table having a `state_key` column).
53+
54+
Changes in SCHEMA_VERSION = 67:
55+
- state_events.prev_state is no longer written to.
5356
"""
5457

5558

0 commit comments

Comments
 (0)