From 1dbd3110403ea80c9fbae4b245c18c530243ccba Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 22 Jun 2021 11:12:23 +0100 Subject: [PATCH 1/2] Fix schema delta to not take as long on large servers Introduced in #6739 --- .../schema/main/delta/59/11add_knock_members_to_stats.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/synapse/storage/schema/main/delta/59/11add_knock_members_to_stats.sql b/synapse/storage/schema/main/delta/59/11add_knock_members_to_stats.sql index 56c0ad000329..8eb2196f6a25 100644 --- a/synapse/storage/schema/main/delta/59/11add_knock_members_to_stats.sql +++ b/synapse/storage/schema/main/delta/59/11add_knock_members_to_stats.sql @@ -13,5 +13,8 @@ * limitations under the License. */ -ALTER TABLE room_stats_current ADD COLUMN knocked_members INT NOT NULL DEFAULT '0'; -ALTER TABLE room_stats_historical ADD COLUMN knocked_members BIGINT NOT NULL DEFAULT '0'; \ No newline at end of file +-- Existing rows will default to NULL, so anything reading from these tables +-- needs to interpret NULL as 0. This is fine here as no existing rooms can have +-- any knocked members. +ALTER TABLE room_stats_current ADD COLUMN knocked_members INT; +ALTER TABLE room_stats_historical ADD COLUMN knocked_members BIGINT; From 9d21e619fa2524918e772954b58eb657253a1883 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 22 Jun 2021 11:13:09 +0100 Subject: [PATCH 2/2] Newsfile --- changelog.d/10227.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/10227.feature diff --git a/changelog.d/10227.feature b/changelog.d/10227.feature new file mode 100644 index 000000000000..9c41140194b2 --- /dev/null +++ b/changelog.d/10227.feature @@ -0,0 +1 @@ +Implement "room knocking" as per [MSC2403](https://github.com/matrix-org/matrix-doc/pull/2403). Contributed by Sorunome and anoa. \ No newline at end of file