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

Fix schema delta to not take as long on large servers #10227

Merged
merged 2 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/10227.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implement "room knocking" as per [MSC2403](https://github.com/matrix-org/matrix-doc/pull/2403). Contributed by Sorunome and anoa.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
-- 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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we're here, why is one INT and one BIGINT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, it does seem a bit odd

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches the existing columns in each table, though I don't know whether we want to deviate from that for future-proofing purposes. Possibly better to do in a separate change though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

room_stats_historical is going away (#9602) so don't sweat it.

ALTER TABLE room_stats_historical ADD COLUMN knocked_members BIGINT;