0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-07-03 01:48:23 +02:00

Pre-populate the unread_count column

This commit is contained in:
Brendan Abolivier 2020-06-12 15:05:47 +01:00
parent 9549d557ea
commit 1e5a50302f
No known key found for this signature in database
GPG key ID: 1E015C145F1916CD

View file

@ -16,3 +16,8 @@
-- Store the number of unread messages, i.e. messages that triggered either a notify
-- action or a mark_unread one.
ALTER TABLE event_push_summary ADD COLUMN unread_count BIGINT NOT NULL DEFAULT 0;
-- Pre-populate the new column with the count of pending notifications.
-- We expect event_push_summary to be relatively small, so we can do this update
-- synchronously without impacting Synapse's startup time too much.
UPDATE event_push_summary SET unread_count = notif_count;