diff --git a/CHANGES.md b/CHANGES.md
index bb34267af3..a52173609d 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,3 +1,76 @@
+# Synapse 1.98.0rc1 (2023-12-05)
+
+Synapse 1.98.0 will be the last Synapse release in 2023; the regular release cadence will resume in January 2024.
+
+Synapse will soon be forked by Element under an AGPLv3.0 licence (with CLA, for
+proprietary dual licensing). You can read more about this here:
+
+ - https://matrix.org/blog/2023/11/06/future-of-synapse-dendrite/
+ - https://element.io/blog/element-to-adopt-agplv3/
+
+The Matrix.org Foundation copy of the project will be archived. Any changes needed
+by server administrators will be communicated via our usual announcements channels,
+but we are striving to make this as seamless as possible.
+
+### Features
+
+- Synapse now declares support for Matrix v1.7, v1.8, and v1.9. ([\#16707](https://github.com/matrix-org/synapse/issues/16707))
+- Add `on_user_login` [module API](https://matrix-org.github.io/synapse/latest/modules/writing_a_module.html) callback allowing to execute custom code after (on) Auth. ([\#15207](https://github.com/matrix-org/synapse/issues/15207))
+- Support [MSC4069: Inhibit profile propagation](https://github.com/matrix-org/matrix-spec-proposals/pull/4069). ([\#16636](https://github.com/matrix-org/synapse/issues/16636))
+- Restore tracking of requests and monthly active users when delegating authentication via [MSC3861](https://github.com/matrix-org/synapse/pull/16672) to an OIDC provider. ([\#16672](https://github.com/matrix-org/synapse/issues/16672))
+- Add an autojoin setting for server notices rooms, so users may be joined directly instead of receiving an invite. ([\#16699](https://github.com/matrix-org/synapse/issues/16699))
+- Follow redirects when downloading media over federation (per [MSC3860](https://github.com/matrix-org/matrix-spec-proposals/pull/3860)). ([\#16701](https://github.com/matrix-org/synapse/issues/16701))
+
+### Bugfixes
+
+- Enable refreshable tokens on the admin registration endpoint. ([\#16642](https://github.com/matrix-org/synapse/issues/16642))
+- Consistently bypass rate limits when using the server notice admin API. ([\#16670](https://github.com/matrix-org/synapse/issues/16670))
+- Fix a bug introduced in Synapse 1.7.2 where rooms whose power levels lacked an `events` field could not be upgraded. ([\#16725](https://github.com/matrix-org/synapse/issues/16725))
+- Fix `GET /_synapse/admin/v1/federation/destinations` [admin API](https://matrix-org.github.io/synapse/latest/usage/administration/admin_api/index.html) returning null (instead of 0) for `retry_last_ts` and `retry_interval`. ([\#16729](https://github.com/matrix-org/synapse/issues/16729))
+
+### Improved Documentation
+
+- Add schema rollback information to documentation. ([\#16661](https://github.com/matrix-org/synapse/issues/16661))
+- Fix poetry version typo in the [contributors' guide](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html). ([\#16695](https://github.com/matrix-org/synapse/issues/16695))
+- Switch the example UNIX socket paths to `/run`. Add HAProxy example configuration for UNIX sockets. ([\#16700](https://github.com/matrix-org/synapse/issues/16700))
+- Add documentation for how to validate the configuration file with `synapse.config` script. ([\#16714](https://github.com/matrix-org/synapse/issues/16714))
+
+### Internal Changes
+
+- Clean-up unused tables. ([\#16522](https://github.com/matrix-org/synapse/issues/16522))
+- Reduce a little database load while processing state auth chains. ([\#16552](https://github.com/matrix-org/synapse/issues/16552))
+- Reduce database load of pruning old `user_ips`. ([\#16667](https://github.com/matrix-org/synapse/issues/16667))
+- Reduce DB load when forget on leave setting is disabled. ([\#16668](https://github.com/matrix-org/synapse/issues/16668))
+- Ignore `encryption_enabled_by_default_for_room_type` setting when creating server notices room, since the notices will be send unencrypted anyway. ([\#16677](https://github.com/matrix-org/synapse/issues/16677))
+- Correctly read the to-device stream ID on startup using SQLite. ([\#16682](https://github.com/matrix-org/synapse/issues/16682))
+- Reoranganise test files. ([\#16684](https://github.com/matrix-org/synapse/issues/16684))
+- Remove old full schema dumps which are no longer used. ([\#16697](https://github.com/matrix-org/synapse/issues/16697))
+- Raise poetry-core upper bound to <=1.8.1. This allows contributors to import Synapse after `poetry install`ing with Poetry 1.6 and above. Contributed by Mo Balaa. ([\#16702](https://github.com/matrix-org/synapse/issues/16702))
+- Add a workflow to try and automatically fixup linting in a PR. ([\#16704](https://github.com/matrix-org/synapse/issues/16704))
+
+
+### Updates to locked dependencies
+
+* Bump cryptography from 41.0.5 to 41.0.6. ([\#16703](https://github.com/matrix-org/synapse/issues/16703))
+* Bump cryptography from 41.0.6 to 41.0.7. ([\#16721](https://github.com/matrix-org/synapse/issues/16721))
+* Bump idna from 3.4 to 3.6. ([\#16720](https://github.com/matrix-org/synapse/issues/16720))
+* Bump jsonschema from 4.19.1 to 4.20.0. ([\#16692](https://github.com/matrix-org/synapse/issues/16692))
+* Bump matrix-org/netlify-pr-preview from 2 to 3. ([\#16719](https://github.com/matrix-org/synapse/issues/16719))
+* Bump phonenumbers from 8.13.23 to 8.13.26. ([\#16722](https://github.com/matrix-org/synapse/issues/16722))
+* Bump prometheus-client from 0.18.0 to 0.19.0. ([\#16691](https://github.com/matrix-org/synapse/issues/16691))
+* Bump pyasn1 from 0.5.0 to 0.5.1. ([\#16689](https://github.com/matrix-org/synapse/issues/16689))
+* Bump pydantic from 2.4.2 to 2.5.1. ([\#16663](https://github.com/matrix-org/synapse/issues/16663))
+* Bump pyo3 (0.19.2→0.20.0), pythonize (0.19.0→0.20.0) and pyo3-log (0.8.1→0.9.0). ([\#16673](https://github.com/matrix-org/synapse/issues/16673))
+* Bump pyopenssl from 23.2.0 to 23.3.0. ([\#16662](https://github.com/matrix-org/synapse/issues/16662))
+* Bump ruff from 0.1.4 to 0.1.6. ([\#16690](https://github.com/matrix-org/synapse/issues/16690))
+* Bump sentry-sdk from 1.32.0 to 1.35.0. ([\#16666](https://github.com/matrix-org/synapse/issues/16666))
+* Bump serde from 1.0.192 to 1.0.193. ([\#16693](https://github.com/matrix-org/synapse/issues/16693))
+* Bump sphinx-autodoc2 from 0.4.2 to 0.5.0. ([\#16723](https://github.com/matrix-org/synapse/issues/16723))
+* Bump types-jsonschema from 4.19.0.4 to 4.20.0.0. ([\#16724](https://github.com/matrix-org/synapse/issues/16724))
+* Bump types-pillow from 10.1.0.0 to 10.1.0.2. ([\#16664](https://github.com/matrix-org/synapse/issues/16664))
+* Bump types-psycopg2 from 2.9.21.15 to 2.9.21.16. ([\#16665](https://github.com/matrix-org/synapse/issues/16665))
+* Bump types-setuptools from 68.2.0.0 to 68.2.0.2. ([\#16688](https://github.com/matrix-org/synapse/issues/16688))
+
# Synapse 1.97.0 (2023-11-28)
Synapse will soon be forked by Element under an AGPLv3.0 licence (with CLA, for
diff --git a/changelog.d/15207.feature b/changelog.d/15207.feature
deleted file mode 100644
index 17790d62eb..0000000000
--- a/changelog.d/15207.feature
+++ /dev/null
@@ -1 +0,0 @@
-Adds on_user_login ModuleAPI callback allowing to execute custom code after (on) Auth.
\ No newline at end of file
diff --git a/changelog.d/16522.misc b/changelog.d/16522.misc
deleted file mode 100644
index 26059b108e..0000000000
--- a/changelog.d/16522.misc
+++ /dev/null
@@ -1 +0,0 @@
-Clean-up unused tables.
diff --git a/changelog.d/16552.misc b/changelog.d/16552.misc
deleted file mode 100644
index 73a0376df0..0000000000
--- a/changelog.d/16552.misc
+++ /dev/null
@@ -1 +0,0 @@
-Reduce a little database load while processing state auth chains.
diff --git a/changelog.d/16636.feature b/changelog.d/16636.feature
deleted file mode 100644
index a363eaafaf..0000000000
--- a/changelog.d/16636.feature
+++ /dev/null
@@ -1 +0,0 @@
-Support MSC4069: Inhibit profile propagation.
\ No newline at end of file
diff --git a/changelog.d/16642.bugfix b/changelog.d/16642.bugfix
deleted file mode 100644
index e83c8b4f9d..0000000000
--- a/changelog.d/16642.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Enable refreshable tokens on the admin registration endpoint.
diff --git a/changelog.d/16658.misc b/changelog.d/16658.misc
deleted file mode 100644
index baee042f2f..0000000000
--- a/changelog.d/16658.misc
+++ /dev/null
@@ -1 +0,0 @@
-Add a Postgres `REPLICA IDENTITY` to tables that do not have an implicit one. This should allow use of Postgres logical replication.
\ No newline at end of file
diff --git a/changelog.d/16661.doc b/changelog.d/16661.doc
deleted file mode 100644
index 74f8fc84b8..0000000000
--- a/changelog.d/16661.doc
+++ /dev/null
@@ -1 +0,0 @@
-Add schema rollback information to documentation.
diff --git a/changelog.d/16667.misc b/changelog.d/16667.misc
deleted file mode 100644
index 51aeca9243..0000000000
--- a/changelog.d/16667.misc
+++ /dev/null
@@ -1 +0,0 @@
-Reduce database load of pruning old `user_ips`.
diff --git a/changelog.d/16668.misc b/changelog.d/16668.misc
deleted file mode 100644
index 9ed004d6e4..0000000000
--- a/changelog.d/16668.misc
+++ /dev/null
@@ -1 +0,0 @@
-Reduce DB load when forget on leave setting is disabled.
diff --git a/changelog.d/16670.bugfix b/changelog.d/16670.bugfix
deleted file mode 100644
index f1369abc06..0000000000
--- a/changelog.d/16670.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Consistently bypass rate limits when using the server notice admin API.
diff --git a/changelog.d/16672.feature b/changelog.d/16672.feature
deleted file mode 100644
index 05ecf22207..0000000000
--- a/changelog.d/16672.feature
+++ /dev/null
@@ -1 +0,0 @@
-Restore tracking of requests and monthly active users when delegating authentication to an [MSC3861](https://github.com/matrix-org/synapse/pull/16672) OIDC provider.
diff --git a/changelog.d/16673.misc b/changelog.d/16673.misc
deleted file mode 100644
index 8b274ede71..0000000000
--- a/changelog.d/16673.misc
+++ /dev/null
@@ -1 +0,0 @@
-Bump pyo3 (0.19.2→0.20.0), pythonize (0.19.0→0.20.0) and pyo3-log (0.8.1→0.9.0).
diff --git a/changelog.d/16677.misc b/changelog.d/16677.misc
deleted file mode 100644
index 20c37851c3..0000000000
--- a/changelog.d/16677.misc
+++ /dev/null
@@ -1 +0,0 @@
-Ignore `encryption_enabled_by_default_for_room_type` setting when creating server notices room, since the notices will be send unencrypted anyway.
diff --git a/changelog.d/16682.misc b/changelog.d/16682.misc
deleted file mode 100644
index 071715e83a..0000000000
--- a/changelog.d/16682.misc
+++ /dev/null
@@ -1 +0,0 @@
-Correctly read the to-device stream ID on startup using SQLite.
diff --git a/changelog.d/16684.misc b/changelog.d/16684.misc
deleted file mode 100644
index 6fb55c08a5..0000000000
--- a/changelog.d/16684.misc
+++ /dev/null
@@ -1 +0,0 @@
-Reoranganise test files.
diff --git a/changelog.d/16695.doc b/changelog.d/16695.doc
deleted file mode 100644
index 6cb284c501..0000000000
--- a/changelog.d/16695.doc
+++ /dev/null
@@ -1 +0,0 @@
-Fix poetry version typo in [contributors' guide](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html).
diff --git a/changelog.d/16697.misc b/changelog.d/16697.misc
deleted file mode 100644
index 02fd236ab4..0000000000
--- a/changelog.d/16697.misc
+++ /dev/null
@@ -1 +0,0 @@
-Remove old full schema dumps which are no longer used.
diff --git a/changelog.d/16699.feature b/changelog.d/16699.feature
deleted file mode 100644
index 7ede50f326..0000000000
--- a/changelog.d/16699.feature
+++ /dev/null
@@ -1 +0,0 @@
-Add an autojoin setting for the notices room so users get joined directly instead of receiving an invite.
diff --git a/changelog.d/16700.doc b/changelog.d/16700.doc
deleted file mode 100644
index 0d55ad338a..0000000000
--- a/changelog.d/16700.doc
+++ /dev/null
@@ -1 +0,0 @@
-Switch the example UNIX socket paths to /run. Add HAProxy example configuration for UNIX sockets.
diff --git a/changelog.d/16701.feature b/changelog.d/16701.feature
deleted file mode 100644
index 2a66fc932a..0000000000
--- a/changelog.d/16701.feature
+++ /dev/null
@@ -1 +0,0 @@
-Follow redirects when downloading media over federation (per [MSC3860](https://github.com/matrix-org/matrix-spec-proposals/pull/3860)).
diff --git a/changelog.d/16702.misc b/changelog.d/16702.misc
deleted file mode 100644
index d97d0a11be..0000000000
--- a/changelog.d/16702.misc
+++ /dev/null
@@ -1 +0,0 @@
-Raise poetry-core upper bound to <=1.8.1. This allows contributors to import Synapse after `poetry install`ing with Poetry 1.6 and above. Contributed by Mo Balaa.
diff --git a/changelog.d/16704.misc b/changelog.d/16704.misc
deleted file mode 100644
index 4dafb27fd8..0000000000
--- a/changelog.d/16704.misc
+++ /dev/null
@@ -1 +0,0 @@
-Add a workflow to try and automatically fixup linting in a PR.
diff --git a/changelog.d/16707.feature b/changelog.d/16707.feature
deleted file mode 100644
index 707502d344..0000000000
--- a/changelog.d/16707.feature
+++ /dev/null
@@ -1 +0,0 @@
-Synapse now declares support for Matrix v1.7, v1.8, and v1.9.
diff --git a/changelog.d/16714.doc b/changelog.d/16714.doc
deleted file mode 100644
index 511d2b6022..0000000000
--- a/changelog.d/16714.doc
+++ /dev/null
@@ -1 +0,0 @@
-Add documentation for how to validate the configuration file with synapse.config script.
diff --git a/changelog.d/16725.bugfix b/changelog.d/16725.bugfix
deleted file mode 100644
index 42dc249fb9..0000000000
--- a/changelog.d/16725.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Fix a bug introduced in Synapse 1.7.2 where rooms whose power levels lacked an `events` field could not be upgraded.
diff --git a/changelog.d/16729.bugfix b/changelog.d/16729.bugfix
deleted file mode 100644
index 50e72ac1f8..0000000000
--- a/changelog.d/16729.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Fix GET /_synapse/admin/v1/federation/destinations returning null (instead of 0) for `retry_last_ts` and `retry_interval`.
diff --git a/changelog.d/16730.misc b/changelog.d/16730.misc
deleted file mode 100644
index baee042f2f..0000000000
--- a/changelog.d/16730.misc
+++ /dev/null
@@ -1 +0,0 @@
-Add a Postgres `REPLICA IDENTITY` to tables that do not have an implicit one. This should allow use of Postgres logical replication.
\ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
index 5ec8771604..b4626f741e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+matrix-synapse-py3 (1.98.0~rc1) stable; urgency=medium
+
+ * New Synapse release 1.98.0rc1.
+
+ -- Synapse Packaging team <packages@matrix.org> Tue, 05 Dec 2023 13:08:42 +0000
+
matrix-synapse-py3 (1.97.0) stable; urgency=medium
* New Synapse release 1.97.0.
diff --git a/pyproject.toml b/pyproject.toml
index eeede837d0..a3eb6111e0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -96,7 +96,7 @@ module-name = "synapse.synapse_rust"
[tool.poetry]
name = "matrix-synapse"
-version = "1.97.0"
+version = "1.98.0rc1"
description = "Homeserver for the Matrix decentralised comms protocol"
authors = ["Matrix.org Team and Contributors <packages@matrix.org>"]
license = "Apache-2.0"
diff --git a/synapse/storage/schema/common/delta/83/10_replica_identity_applied_module_schemas.sql.postgres b/synapse/storage/schema/common/delta/83/10_replica_identity_applied_module_schemas.sql.postgres
deleted file mode 100644
index 57c35b6430..0000000000
--- a/synapse/storage/schema/common/delta/83/10_replica_identity_applied_module_schemas.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE applied_module_schemas REPLICA IDENTITY USING INDEX applied_module_schemas_module_name_file_key;
diff --git a/synapse/storage/schema/common/delta/83/10_replica_identity_applied_schema_deltas.sql.postgres b/synapse/storage/schema/common/delta/83/10_replica_identity_applied_schema_deltas.sql.postgres
deleted file mode 100644
index 1426f9a9e4..0000000000
--- a/synapse/storage/schema/common/delta/83/10_replica_identity_applied_schema_deltas.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE applied_schema_deltas REPLICA IDENTITY USING INDEX applied_schema_deltas_version_file_key;
diff --git a/synapse/storage/schema/common/delta/83/10_replica_identity_background_updates.sql.postgres b/synapse/storage/schema/common/delta/83/10_replica_identity_background_updates.sql.postgres
deleted file mode 100644
index f04937b3db..0000000000
--- a/synapse/storage/schema/common/delta/83/10_replica_identity_background_updates.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE background_updates REPLICA IDENTITY USING INDEX background_updates_uniqueness;
diff --git a/synapse/storage/schema/common/delta/83/10_replica_identity_schema_compat_version.sql.postgres b/synapse/storage/schema/common/delta/83/10_replica_identity_schema_compat_version.sql.postgres
deleted file mode 100644
index e3a6f7ca4f..0000000000
--- a/synapse/storage/schema/common/delta/83/10_replica_identity_schema_compat_version.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE schema_compat_version REPLICA IDENTITY USING INDEX schema_compat_version_lock_key;
diff --git a/synapse/storage/schema/common/delta/83/10_replica_identity_schema_version.sql.postgres b/synapse/storage/schema/common/delta/83/10_replica_identity_schema_version.sql.postgres
deleted file mode 100644
index c10efe0563..0000000000
--- a/synapse/storage/schema/common/delta/83/10_replica_identity_schema_version.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE schema_version REPLICA IDENTITY USING INDEX schema_version_lock_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_README.md b/synapse/storage/schema/main/delta/83/10_replica_identity_README.md
deleted file mode 100644
index fd7bdfc7ad..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-The `10_replica_identity_xxx.sql.postgres` series of schema deltas adds replica identities for tables that do not have one implicitly as a result of having a primary key.
-
-This is needed to use logical replication with Synapse (at least without `UPDATE` and `DELETE` statements failing!).
-
-Where possible, we use an existing `UNIQUE` index on `NOT NULL` columns as the replica identity. Otherwise, we have to fall back to using the full row as a replica identity.
-
-Unfortunately, by running all the `ALTER TABLE` statements in one schema delta per database, it was too likely to hit a deadlock as it would only take
-one other transaction from a running Synapse worker to access the tables out of order and trigger a deadlock.
-
-By having each statement in its own delta file, each one is run in its own transaction and only needs to take a very brief (instant) lock on the table but no other tables,
-so there should be no chance of deadlock.
-
-Like many schema deltas we already apply to Synapse, it is probably blocked by an ongoing `pg_dump`.
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_account_data.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_account_data.sql.postgres
deleted file mode 100644
index 1bf720e80e..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_account_data.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE account_data REPLICA IDENTITY USING INDEX account_data_uniqueness;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_application_services_txns.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_application_services_txns.sql.postgres
deleted file mode 100644
index 4ec052ebeb..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_application_services_txns.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE application_services_txns REPLICA IDENTITY USING INDEX application_services_txns_as_id_txn_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_appservice_room_list.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_appservice_room_list.sql.postgres
deleted file mode 100644
index 232a628ca2..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_appservice_room_list.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE appservice_room_list REPLICA IDENTITY USING INDEX appservice_room_list_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_appservice_stream_position.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_appservice_stream_position.sql.postgres
deleted file mode 100644
index e870a68723..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_appservice_stream_position.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE appservice_stream_position REPLICA IDENTITY USING INDEX appservice_stream_position_lock_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_blocked_rooms.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_blocked_rooms.sql.postgres
deleted file mode 100644
index e3fce4045f..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_blocked_rooms.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE blocked_rooms REPLICA IDENTITY USING INDEX blocked_rooms_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_cache_invalidation_stream_by_instance.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_cache_invalidation_stream_by_instance.sql.postgres
deleted file mode 100644
index 4fd87faaf6..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_cache_invalidation_stream_by_instance.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE cache_invalidation_stream_by_instance REPLICA IDENTITY USING INDEX cache_invalidation_stream_by_instance_id;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_current_state_delta_stream.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_current_state_delta_stream.sql.postgres
deleted file mode 100644
index b618286e8a..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_current_state_delta_stream.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE current_state_delta_stream REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_current_state_events.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_current_state_events.sql.postgres
deleted file mode 100644
index b058a9f06e..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_current_state_events.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE current_state_events REPLICA IDENTITY USING INDEX current_state_events_event_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_deleted_pushers.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_deleted_pushers.sql.postgres
deleted file mode 100644
index 0b4fcc5ae1..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_deleted_pushers.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE deleted_pushers REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_device_auth_providers.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_device_auth_providers.sql.postgres
deleted file mode 100644
index 8e02438b47..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_device_auth_providers.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE device_auth_providers REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_device_federation_inbox.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_device_federation_inbox.sql.postgres
deleted file mode 100644
index 547e485f00..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_device_federation_inbox.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE device_federation_inbox REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_device_federation_outbox.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_device_federation_outbox.sql.postgres
deleted file mode 100644
index 809afe4dc5..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_device_federation_outbox.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE device_federation_outbox REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_device_inbox.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_device_inbox.sql.postgres
deleted file mode 100644
index 07652038a2..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_device_inbox.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE device_inbox REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_changes_converted_stream_position.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_changes_converted_stream_position.sql.postgres
deleted file mode 100644
index 8474b8c842..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_changes_converted_stream_position.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE device_lists_changes_converted_stream_position REPLICA IDENTITY USING INDEX device_lists_changes_converted_stream_position_lock_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_changes_in_room.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_changes_in_room.sql.postgres
deleted file mode 100644
index 712a54bc0f..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_changes_in_room.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE device_lists_changes_in_room REPLICA IDENTITY USING INDEX device_lists_changes_in_stream_id;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_outbound_last_success.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_outbound_last_success.sql.postgres
deleted file mode 100644
index 4357690e8d..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_outbound_last_success.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE device_lists_outbound_last_success REPLICA IDENTITY USING INDEX device_lists_outbound_last_success_unique_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_outbound_pokes.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_outbound_pokes.sql.postgres
deleted file mode 100644
index cc724877cf..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_outbound_pokes.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE device_lists_outbound_pokes REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_remote_cache.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_remote_cache.sql.postgres
deleted file mode 100644
index ea4351c654..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_remote_cache.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE device_lists_remote_cache REPLICA IDENTITY USING INDEX device_lists_remote_cache_unique_id;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_remote_extremeties.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_remote_extremeties.sql.postgres
deleted file mode 100644
index 9dc3bec6fa..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_remote_extremeties.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE device_lists_remote_extremeties REPLICA IDENTITY USING INDEX device_lists_remote_extremeties_unique_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_remote_resync.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_remote_resync.sql.postgres
deleted file mode 100644
index df3cecfb94..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_remote_resync.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE device_lists_remote_resync REPLICA IDENTITY USING INDEX device_lists_remote_resync_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_stream.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_stream.sql.postgres
deleted file mode 100644
index 30a7922613..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_device_lists_stream.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE device_lists_stream REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_devices.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_devices.sql.postgres
deleted file mode 100644
index 57d54a0dc0..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_devices.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE devices REPLICA IDENTITY USING INDEX device_uniqueness;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_cross_signing_keys.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_cross_signing_keys.sql.postgres
deleted file mode 100644
index f3f2693631..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_cross_signing_keys.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE e2e_cross_signing_keys REPLICA IDENTITY USING INDEX e2e_cross_signing_keys_stream_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_cross_signing_signatures.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_cross_signing_signatures.sql.postgres
deleted file mode 100644
index d2347b7153..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_cross_signing_signatures.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE e2e_cross_signing_signatures REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_device_keys_json.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_device_keys_json.sql.postgres
deleted file mode 100644
index 66dafdc8e1..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_device_keys_json.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE e2e_device_keys_json REPLICA IDENTITY USING INDEX e2e_device_keys_json_uniqueness;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_fallback_keys_json.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_fallback_keys_json.sql.postgres
deleted file mode 100644
index 8bb4dfc78b..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_fallback_keys_json.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE e2e_fallback_keys_json REPLICA IDENTITY USING INDEX e2e_fallback_keys_json_uniqueness;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_one_time_keys_json.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_one_time_keys_json.sql.postgres
deleted file mode 100644
index b6609cfdfb..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_one_time_keys_json.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE e2e_one_time_keys_json REPLICA IDENTITY USING INDEX e2e_one_time_keys_json_uniqueness;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_room_keys.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_room_keys.sql.postgres
deleted file mode 100644
index 9b98924165..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_room_keys.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE e2e_room_keys REPLICA IDENTITY USING INDEX e2e_room_keys_with_version_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_room_keys_versions.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_room_keys_versions.sql.postgres
deleted file mode 100644
index ac7aaba44d..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_e2e_room_keys_versions.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE e2e_room_keys_versions REPLICA IDENTITY USING INDEX e2e_room_keys_versions_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_erased_users.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_erased_users.sql.postgres
deleted file mode 100644
index c775f81333..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_erased_users.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE erased_users REPLICA IDENTITY USING INDEX erased_users_user;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_auth.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_auth.sql.postgres
deleted file mode 100644
index d8014d123b..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_auth.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_auth REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_auth_chain_links.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_auth_chain_links.sql.postgres
deleted file mode 100644
index c2f9c90d42..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_auth_chain_links.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_auth_chain_links REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_backward_extremities.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_backward_extremities.sql.postgres
deleted file mode 100644
index 751541a929..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_backward_extremities.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_backward_extremities REPLICA IDENTITY USING INDEX event_backward_extremities_event_id_room_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_edges.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_edges.sql.postgres
deleted file mode 100644
index 066ea763f1..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_edges.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_edges REPLICA IDENTITY USING INDEX event_edges_event_id_prev_event_id_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_forward_extremities.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_forward_extremities.sql.postgres
deleted file mode 100644
index d70d6fd55c..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_forward_extremities.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_forward_extremities REPLICA IDENTITY USING INDEX event_forward_extremities_event_id_room_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_json.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_json.sql.postgres
deleted file mode 100644
index b614b96422..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_json.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_json REPLICA IDENTITY USING INDEX event_json_event_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_actions.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_actions.sql.postgres
deleted file mode 100644
index 7a92620270..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_actions.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_push_actions REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_actions_staging.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_actions_staging.sql.postgres
deleted file mode 100644
index 292ed9787d..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_actions_staging.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_push_actions_staging REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_summary.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_summary.sql.postgres
deleted file mode 100644
index 42a9b6b676..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_summary.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_push_summary REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_summary_last_receipt_stream_id.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_summary_last_receipt_stream_id.sql.postgres
deleted file mode 100644
index 707e498a6e..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_summary_last_receipt_stream_id.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_push_summary_last_receipt_stream_id REPLICA IDENTITY USING INDEX event_push_summary_last_receipt_stream_id_lock_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_summary_stream_ordering.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_summary_stream_ordering.sql.postgres
deleted file mode 100644
index 1240e3e1b5..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_push_summary_stream_ordering.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_push_summary_stream_ordering REPLICA IDENTITY USING INDEX event_push_summary_stream_ordering_lock_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_relations.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_relations.sql.postgres
deleted file mode 100644
index 6b62a6bc20..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_relations.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_relations REPLICA IDENTITY USING INDEX event_relations_id;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_search.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_search.sql.postgres
deleted file mode 100644
index e8467fc3d3..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_search.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_search REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_to_state_groups.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_to_state_groups.sql.postgres
deleted file mode 100644
index 4206975c35..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_to_state_groups.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_to_state_groups REPLICA IDENTITY USING INDEX event_to_state_groups_event_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_event_txn_id_device_id.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_event_txn_id_device_id.sql.postgres
deleted file mode 100644
index 05fce1e6b0..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_event_txn_id_device_id.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE event_txn_id_device_id REPLICA IDENTITY USING INDEX event_txn_id_device_id_event_id;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_events.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_events.sql.postgres
deleted file mode 100644
index 9046b8eb08..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_events.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE events REPLICA IDENTITY USING INDEX events_event_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_federation_inbound_events_staging.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_federation_inbound_events_staging.sql.postgres
deleted file mode 100644
index d9d2f88f67..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_federation_inbound_events_staging.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE federation_inbound_events_staging REPLICA IDENTITY USING INDEX federation_inbound_events_staging_instance_event;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_federation_stream_position.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_federation_stream_position.sql.postgres
deleted file mode 100644
index 5f9df14d7d..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_federation_stream_position.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE federation_stream_position REPLICA IDENTITY USING INDEX federation_stream_position_instance;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_ignored_users.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_ignored_users.sql.postgres
deleted file mode 100644
index dd082b7f9e..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_ignored_users.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE ignored_users REPLICA IDENTITY USING INDEX ignored_users_uniqueness;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_local_current_membership.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_local_current_membership.sql.postgres
deleted file mode 100644
index f36bad701a..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_local_current_membership.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE local_current_membership REPLICA IDENTITY USING INDEX local_current_membership_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_local_media_repository.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_local_media_repository.sql.postgres
deleted file mode 100644
index 78a5128af3..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_local_media_repository.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE local_media_repository REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_local_media_repository_thumbnails.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_local_media_repository_thumbnails.sql.postgres
deleted file mode 100644
index 6cd53f8e15..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_local_media_repository_thumbnails.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE local_media_repository_thumbnails REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_local_media_repository_url_cache.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_local_media_repository_url_cache.sql.postgres
deleted file mode 100644
index a41590ce6b..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_local_media_repository_url_cache.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE local_media_repository_url_cache REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_monthly_active_users.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_monthly_active_users.sql.postgres
deleted file mode 100644
index 326fc279d3..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_monthly_active_users.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE monthly_active_users REPLICA IDENTITY USING INDEX monthly_active_users_users;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_partial_state_events.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_partial_state_events.sql.postgres
deleted file mode 100644
index c6acd84315..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_partial_state_events.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE partial_state_events REPLICA IDENTITY USING INDEX partial_state_events_event_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_partial_state_rooms_servers.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_partial_state_rooms_servers.sql.postgres
deleted file mode 100644
index c618660b5f..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_partial_state_rooms_servers.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE partial_state_rooms_servers REPLICA IDENTITY USING INDEX partial_state_rooms_servers_room_id_server_name_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_presence_stream.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_presence_stream.sql.postgres
deleted file mode 100644
index 4e5d8d7a68..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_presence_stream.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE presence_stream REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_profiles.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_profiles.sql.postgres
deleted file mode 100644
index bb25e7a67a..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_profiles.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE profiles REPLICA IDENTITY USING INDEX profiles_user_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_push_rules_stream.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_push_rules_stream.sql.postgres
deleted file mode 100644
index f305d9a73a..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_push_rules_stream.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE push_rules_stream REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_ratelimit_override.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_ratelimit_override.sql.postgres
deleted file mode 100644
index f10f359155..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_ratelimit_override.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE ratelimit_override REPLICA IDENTITY USING INDEX ratelimit_override_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_receipts_graph.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_receipts_graph.sql.postgres
deleted file mode 100644
index 954dd92667..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_receipts_graph.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE receipts_graph REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_receipts_linearized.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_receipts_linearized.sql.postgres
deleted file mode 100644
index 302d887531..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_receipts_linearized.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE receipts_linearized REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_received_transactions.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_received_transactions.sql.postgres
deleted file mode 100644
index 3b8c227717..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_received_transactions.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE received_transactions REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_redactions.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_redactions.sql.postgres
deleted file mode 100644
index ffa3444b95..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_redactions.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE redactions REPLICA IDENTITY USING INDEX redactions_event_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_registration_tokens.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_registration_tokens.sql.postgres
deleted file mode 100644
index 3fdb5bbd54..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_registration_tokens.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE registration_tokens REPLICA IDENTITY USING INDEX registration_tokens_token_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_rejections.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_rejections.sql.postgres
deleted file mode 100644
index c7a7218578..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_rejections.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE rejections REPLICA IDENTITY USING INDEX rejections_event_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_remote_media_cache.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_remote_media_cache.sql.postgres
deleted file mode 100644
index d0ecfe1a75..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_remote_media_cache.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE remote_media_cache REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_remote_media_cache_thumbnails.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_remote_media_cache_thumbnails.sql.postgres
deleted file mode 100644
index 9d7b63dfb4..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_remote_media_cache_thumbnails.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE remote_media_cache_thumbnails REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_room_account_data.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_room_account_data.sql.postgres
deleted file mode 100644
index 36e756f6b1..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_room_account_data.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE room_account_data REPLICA IDENTITY USING INDEX room_account_data_uniqueness;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_room_alias_servers.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_room_alias_servers.sql.postgres
deleted file mode 100644
index df550076ac..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_room_alias_servers.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE room_alias_servers REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_room_aliases.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_room_aliases.sql.postgres
deleted file mode 100644
index bfe8db5375..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_room_aliases.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE room_aliases REPLICA IDENTITY USING INDEX room_aliases_room_alias_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_room_depth.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_room_depth.sql.postgres
deleted file mode 100644
index 77c78ee4ab..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_room_depth.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE room_depth REPLICA IDENTITY USING INDEX room_depth_room_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_room_forgetter_stream_pos.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_room_forgetter_stream_pos.sql.postgres
deleted file mode 100644
index 51de67b549..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_room_forgetter_stream_pos.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE room_forgetter_stream_pos REPLICA IDENTITY USING INDEX room_forgetter_stream_pos_lock_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_room_memberships.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_room_memberships.sql.postgres
deleted file mode 100644
index 5819409058..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_room_memberships.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE room_memberships REPLICA IDENTITY USING INDEX room_memberships_event_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_room_stats_earliest_token.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_room_stats_earliest_token.sql.postgres
deleted file mode 100644
index bacd9587d2..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_room_stats_earliest_token.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE room_stats_earliest_token REPLICA IDENTITY USING INDEX room_stats_earliest_token_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_room_stats_state.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_room_stats_state.sql.postgres
deleted file mode 100644
index a64db05f44..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_room_stats_state.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE room_stats_state REPLICA IDENTITY USING INDEX room_stats_state_room;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_room_tags.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_room_tags.sql.postgres
deleted file mode 100644
index cc69704751..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_room_tags.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE room_tags REPLICA IDENTITY USING INDEX room_tag_uniqueness;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_room_tags_revisions.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_room_tags_revisions.sql.postgres
deleted file mode 100644
index d31063277c..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_room_tags_revisions.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE room_tags_revisions REPLICA IDENTITY USING INDEX room_tag_revisions_uniqueness;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_server_keys_json.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_server_keys_json.sql.postgres
deleted file mode 100644
index 9c0bfb5623..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_server_keys_json.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE server_keys_json REPLICA IDENTITY USING INDEX server_keys_json_uniqueness;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_server_signature_keys.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_server_signature_keys.sql.postgres
deleted file mode 100644
index 1b3d5e68e5..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_server_signature_keys.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE server_signature_keys REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_sessions.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_sessions.sql.postgres
deleted file mode 100644
index eb8d621795..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_sessions.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE sessions REPLICA IDENTITY USING INDEX sessions_session_type_session_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_state_events.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_state_events.sql.postgres
deleted file mode 100644
index 7e23c8a054..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_state_events.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE state_events REPLICA IDENTITY USING INDEX state_events_event_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_stats_incremental_position.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_stats_incremental_position.sql.postgres
deleted file mode 100644
index a4a700a3a4..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_stats_incremental_position.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE stats_incremental_position REPLICA IDENTITY USING INDEX stats_incremental_position_lock_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_stream_ordering_to_exterm.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_stream_ordering_to_exterm.sql.postgres
deleted file mode 100644
index a700741896..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_stream_ordering_to_exterm.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE stream_ordering_to_exterm REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_stream_positions.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_stream_positions.sql.postgres
deleted file mode 100644
index 83ff1c3825..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_stream_positions.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE stream_positions REPLICA IDENTITY USING INDEX stream_positions_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_threads.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_threads.sql.postgres
deleted file mode 100644
index a3891e4208..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_threads.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE threads REPLICA IDENTITY USING INDEX threads_uniqueness;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_threepid_guest_access_tokens.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_threepid_guest_access_tokens.sql.postgres
deleted file mode 100644
index df31cf4f1d..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_threepid_guest_access_tokens.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE threepid_guest_access_tokens REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_timeline_gaps.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_timeline_gaps.sql.postgres
deleted file mode 100644
index 8fb41226c1..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_timeline_gaps.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE timeline_gaps REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_ui_auth_sessions.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_ui_auth_sessions.sql.postgres
deleted file mode 100644
index 5d2af97f72..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_ui_auth_sessions.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE ui_auth_sessions REPLICA IDENTITY USING INDEX ui_auth_sessions_session_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_ui_auth_sessions_credentials.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_ui_auth_sessions_credentials.sql.postgres
deleted file mode 100644
index efb2359faa..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_ui_auth_sessions_credentials.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE ui_auth_sessions_credentials REPLICA IDENTITY USING INDEX ui_auth_sessions_credentials_session_id_stage_type_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_ui_auth_sessions_ips.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_ui_auth_sessions_ips.sql.postgres
deleted file mode 100644
index a4b86eaf07..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_ui_auth_sessions_ips.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE ui_auth_sessions_ips REPLICA IDENTITY USING INDEX ui_auth_sessions_ips_session_id_ip_user_agent_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_user_daily_visits.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_user_daily_visits.sql.postgres
deleted file mode 100644
index bb22ec5335..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_user_daily_visits.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE user_daily_visits REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_user_directory.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_user_directory.sql.postgres
deleted file mode 100644
index 947f8c5c0f..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_user_directory.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE user_directory REPLICA IDENTITY USING INDEX user_directory_user_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_user_directory_search.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_user_directory_search.sql.postgres
deleted file mode 100644
index d421779944..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_user_directory_search.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE user_directory_search REPLICA IDENTITY USING INDEX user_directory_search_user_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_user_directory_stream_pos.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_user_directory_stream_pos.sql.postgres
deleted file mode 100644
index 59201750b0..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_user_directory_stream_pos.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE user_directory_stream_pos REPLICA IDENTITY USING INDEX user_directory_stream_pos_lock_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_user_external_ids.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_user_external_ids.sql.postgres
deleted file mode 100644
index 219ee16dde..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_user_external_ids.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE user_external_ids REPLICA IDENTITY USING INDEX user_external_ids_auth_provider_external_id_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_user_filters.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_user_filters.sql.postgres
deleted file mode 100644
index 5d3e0ae475..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_user_filters.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE user_filters REPLICA IDENTITY FULL; -- sadly the `CHECK` constraint is not enough here
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_user_ips.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_user_ips.sql.postgres
deleted file mode 100644
index 5a1d8770d0..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_user_ips.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE user_ips REPLICA IDENTITY USING INDEX user_ips_user_token_ip_unique_index;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_user_signature_stream.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_user_signature_stream.sql.postgres
deleted file mode 100644
index 8bc27df00a..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_user_signature_stream.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE user_signature_stream REPLICA IDENTITY USING INDEX user_signature_stream_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_user_threepid_id_server.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_user_threepid_id_server.sql.postgres
deleted file mode 100644
index a0ba8e6773..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_user_threepid_id_server.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE user_threepid_id_server REPLICA IDENTITY USING INDEX user_threepid_id_server_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_user_threepids.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_user_threepids.sql.postgres
deleted file mode 100644
index 9c70c9011e..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_user_threepids.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE user_threepids REPLICA IDENTITY USING INDEX medium_address;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_users.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_users.sql.postgres
deleted file mode 100644
index 725e6cdc76..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_users.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE users REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_users_in_public_rooms.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_users_in_public_rooms.sql.postgres
deleted file mode 100644
index 86988a5550..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_users_in_public_rooms.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE users_in_public_rooms REPLICA IDENTITY USING INDEX users_in_public_rooms_u_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_users_pending_deactivation.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_users_pending_deactivation.sql.postgres
deleted file mode 100644
index 7e72946d14..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_users_pending_deactivation.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE users_pending_deactivation REPLICA IDENTITY FULL;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_users_who_share_private_rooms.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_users_who_share_private_rooms.sql.postgres
deleted file mode 100644
index 6c7213920a..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_users_who_share_private_rooms.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE users_who_share_private_rooms REPLICA IDENTITY USING INDEX users_who_share_private_rooms_u_idx;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_worker_locks.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_worker_locks.sql.postgres
deleted file mode 100644
index 1bba45e05c..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_worker_locks.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE worker_locks REPLICA IDENTITY USING INDEX worker_locks_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_worker_read_write_locks.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_worker_read_write_locks.sql.postgres
deleted file mode 100644
index b9d35eb4f6..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_worker_read_write_locks.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE worker_read_write_locks REPLICA IDENTITY USING INDEX worker_read_write_locks_key;
diff --git a/synapse/storage/schema/main/delta/83/10_replica_identity_worker_read_write_locks_mode.sql.postgres b/synapse/storage/schema/main/delta/83/10_replica_identity_worker_read_write_locks_mode.sql.postgres
deleted file mode 100644
index 5871c98dee..0000000000
--- a/synapse/storage/schema/main/delta/83/10_replica_identity_worker_read_write_locks_mode.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE worker_read_write_locks_mode REPLICA IDENTITY USING INDEX worker_read_write_locks_mode_key;
diff --git a/synapse/storage/schema/state/delta/83/10_replica_identity_state_group_edges.sql.postgres b/synapse/storage/schema/state/delta/83/10_replica_identity_state_group_edges.sql.postgres
deleted file mode 100644
index aa8fc2514c..0000000000
--- a/synapse/storage/schema/state/delta/83/10_replica_identity_state_group_edges.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE state_group_edges REPLICA IDENTITY USING INDEX state_group_edges_unique_idx;
diff --git a/synapse/storage/schema/state/delta/83/10_replica_identity_state_groups_state.sql.postgres b/synapse/storage/schema/state/delta/83/10_replica_identity_state_groups_state.sql.postgres
deleted file mode 100644
index 4386031977..0000000000
--- a/synapse/storage/schema/state/delta/83/10_replica_identity_state_groups_state.sql.postgres
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE state_groups_state REPLICA IDENTITY FULL;
diff --git a/tests/storage/test_database.py b/tests/storage/test_database.py
index aa8c76f187..4d0ebb550d 100644
--- a/tests/storage/test_database.py
+++ b/tests/storage/test_database.py
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from typing import Callable, List, Tuple
+from typing import Callable, Tuple
from unittest.mock import Mock, call
from twisted.internet import defer
@@ -29,7 +29,6 @@ from synapse.storage.database import (
from synapse.util import Clock
from tests import unittest
-from tests.utils import USE_POSTGRES_FOR_TESTS
class TupleComparisonClauseTestCase(unittest.TestCase):
@@ -280,85 +279,3 @@ class CancellationTestCase(unittest.HomeserverTestCase):
]
)
self.assertEqual(exception_callback.call_count, 6) # no additional calls
-
-
-class PostgresReplicaIdentityTestCase(unittest.HomeserverTestCase):
- if not USE_POSTGRES_FOR_TESTS:
- skip = "Requires Postgres"
-
- def prepare(
- self, reactor: MemoryReactor, clock: Clock, homeserver: HomeServer
- ) -> None:
- self.db_pools = homeserver.get_datastores().databases
-
- def test_all_tables_have_postgres_replica_identity(self) -> None:
- """
- Tests that all tables have a Postgres REPLICA IDENTITY.
- (See https://github.com/matrix-org/synapse/issues/16224).
-
- Tables with a PRIMARY KEY have an implied REPLICA IDENTITY and are fine.
- Other tables need them to be set with `ALTER TABLE`.
-
- A REPLICA IDENTITY is required for Postgres logical replication to work
- properly without blocking updates and deletes.
- """
-
- sql = """
- -- Select tables that have no primary key and use the default replica identity rule
- -- (the default is to use the primary key)
- WITH tables_no_pkey AS (
- SELECT tbl.table_schema, tbl.table_name
- FROM information_schema.tables tbl
- WHERE table_type = 'BASE TABLE'
- AND table_schema not in ('pg_catalog', 'information_schema')
- AND NOT EXISTS (
- SELECT 1
- FROM information_schema.table_constraints tc
- WHERE tc.constraint_type = 'PRIMARY KEY'
- AND tc.table_schema = tbl.table_schema
- AND tc.table_name = tbl.table_name
- )
- )
- SELECT pg_class.oid::regclass FROM tables_no_pkey INNER JOIN pg_class ON pg_class.oid::regclass = table_name::regclass
- WHERE relreplident = 'd'
-
- UNION
-
- -- Also select tables that use an index as a replica identity
- -- but where the index doesn't exist
- -- (e.g. it could have been deleted)
- SELECT pg_class.oid::regclass
- FROM information_schema.tables tbl
- INNER JOIN pg_class ON pg_class.oid::regclass = table_name::regclass
- WHERE table_type = 'BASE TABLE'
- AND table_schema not in ('pg_catalog', 'information_schema')
-
- -- 'i' means an index is used as the replica identity
- AND relreplident = 'i'
-
- -- look for indices that are marked as the replica identity
- AND NOT EXISTS (
- SELECT indexrelid::regclass
- FROM pg_index
- WHERE indrelid = pg_class.oid::regclass AND indisreplident
- )
- """
-
- def _list_tables_with_missing_replica_identities_txn(
- txn: LoggingTransaction,
- ) -> List[str]:
- txn.execute(sql)
- return [table_name for table_name, in txn]
-
- for pool in self.db_pools:
- missing = self.get_success(
- pool.runInteraction(
- "test_list_missing_replica_identities",
- _list_tables_with_missing_replica_identities_txn,
- )
- )
- self.assertEqual(
- len(missing),
- 0,
- f"The following tables in the {pool.name()!r} database are missing REPLICA IDENTITIES: {missing!r}.",
- )
|