Repository navigation
feat(db): the room trigger takes a part with a row per room - #695
Merged
Merged
Conversation
Parallel rooms R4, the migration before the writers (no dual-write). The Item_room trigger: - on a part with a row per room, puts a write of the item's people (a version still running) on its main room's row alone, ignores its track, and moves its rows with it to another programme (by room name) without failing; - on a part in one room, takes only the people and conflict a write changed, so a conflict refresh by a running version keeps the row's newer people. Who holds what is unchanged; today's code runs as before with it (every part holds one row).
No writer moves one; remapping its rows by name could rename the target's unnamed main room and drop a room's person on the unique key. Raised, so a future writer learns it rather than losing someone.
As a move is: leaving it (no schedule, or a services schedule) would take every room's people with its rows. No writer does it.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Parallel rooms R4, PR 4a: the migration that comes before the writers. It is safe with the code running today, which this PR doesn't change.
Migration
20261204090000_rooms_writersreplacesitem_room(), nothing else.(itemId, roomId).track/trackOrderis ignored: its rows are its rooms.scheduleId, which means another meeting): refused with an exception. No writer does it today, and remapping its rows by name could rename the target's unnamed main room and drop a room's person, so a future writer finds out instead. Leaving its programme (no schedule, or a services schedule), which would take every room's people with its rows, is refused the same way.UPDATEcopies only the people and conflict it changed. A conflict refresh by a version still running then keeps the row's newer people, which R4's writers write on the row alone. AnINSERTstill copies everything, and the room-follows-track behaviour and pruning are kept.Contract: who holds what is unchanged. Every part holds one row today, and the row equals the item's columns.
Not here:
Item.updatedAtfollowing a row write. A trigger would stamp the transaction's start time, earlier than the app's ownupdatedAt: it would break the EventPart→Item copy test's equality and move the calendar-feed references, which freeze time. The writers (PR 4b) touch the item themselves, on the app's clock.Tests:
rooms-writersintegration, on the rooms fixture's meeting with a row per room:All six failed before the migration (unique violations, wrong values) and pass after.
Checked like CI:
prisma migrate deployon the test database, then the whole integration suite on today's code with the new trigger: 188 files, references included, all pass.Next, PR 4b:
assignPart/unassignPart/refreshConflictFlags/deleteExternalSpeakerwrite the room's row and touch the item. It merges only after #690–#694, which move every reader to the rows.