This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Update event push action and receipt tables to support threads. #13753
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e570233
Update event push action and receipt tables to support threads.
clokep 59e2789
Backfill the thread_id column for event_push_actions and event_push_s…
clokep fc8e0fa
Insert a thread_id when inserting new data.
clokep b7a7d6d
Add docstring to background update.
clokep 8bce650
Bump the schema version.
clokep 0514093
Rename deltas from 72 -> 73.
clokep d5d6874
Merge remote-tracking branch 'origin/develop' into clokep/threads-not…
clokep 8b937e5
Revert "Rename deltas from 72 -> 73."
clokep 9312d1a
Add event_stream_ordering column to receipts_linearized.
clokep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Prepatory work for storing thread IDs for notifications and receipts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2192,9 +2192,9 @@ def _set_push_actions_for_event_and_users_txn( | |
sql = """ | ||
INSERT INTO event_push_actions ( | ||
room_id, event_id, user_id, actions, stream_ordering, | ||
topological_ordering, notif, highlight, unread | ||
topological_ordering, notif, highlight, unread, thread_id | ||
) | ||
SELECT ?, event_id, user_id, actions, ?, ?, notif, highlight, unread | ||
SELECT ?, event_id, user_id, actions, ?, ?, notif, highlight, unread, thread_id | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should be providing the |
||
FROM event_push_actions_staging | ||
WHERE event_id = ? | ||
""" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
synapse/storage/schema/main/delta/72/06thread_notifications.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* Copyright 2022 The Matrix.org Foundation C.I.C | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
-- Add a nullable column for thread ID to the event push actions tables; this | ||
-- will be filled in with a default value for any previously existing rows. | ||
-- | ||
-- After migration this can be made non-nullable. | ||
|
||
ALTER TABLE event_push_actions_staging ADD COLUMN thread_id TEXT; | ||
ALTER TABLE event_push_actions ADD COLUMN thread_id TEXT; | ||
ALTER TABLE event_push_summary ADD COLUMN thread_id TEXT; | ||
|
||
-- Update the unique index for `event_push_summary`. | ||
INSERT INTO background_updates (ordering, update_name, progress_json) VALUES | ||
(7006, 'event_push_summary_unique_index2', '{}'); | ||
|
||
INSERT INTO background_updates (ordering, update_name, progress_json, depends_on) VALUES | ||
(7006, 'event_push_backfill_thread_id', '{}', 'event_push_summary_unique_index2'); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.