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

Commit 1dbd311

Browse files
committed
Fix schema delta to not take as long on large servers
Introduced in #6739
1 parent 96f6293 commit 1dbd311

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

synapse/storage/schema/main/delta/59/11add_knock_members_to_stats.sql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
* limitations under the License.
1414
*/
1515

16-
ALTER TABLE room_stats_current ADD COLUMN knocked_members INT NOT NULL DEFAULT '0';
17-
ALTER TABLE room_stats_historical ADD COLUMN knocked_members BIGINT NOT NULL DEFAULT '0';
16+
-- Existing rows will default to NULL, so anything reading from these tables
17+
-- needs to interpret NULL as 0. This is fine here as no existing rooms can have
18+
-- any knocked members.
19+
ALTER TABLE room_stats_current ADD COLUMN knocked_members INT;
20+
ALTER TABLE room_stats_historical ADD COLUMN knocked_members BIGINT;

0 commit comments

Comments
 (0)