fix: change flowsheet.play_order from serial to integer#192
Open
jakebromberg wants to merge 4 commits intomainfrom
Open
fix: change flowsheet.play_order from serial to integer#192jakebromberg wants to merge 4 commits intomainfrom
jakebromberg wants to merge 4 commits intomainfrom
Conversation
9 tasks
play_order is manually managed by reorder operations and should not auto-increment. The serial type wasted a sequence and could collide with manually assigned values. Co-authored-by: Cursor <cursoragent@cursor.com>
220a205 to
8133555
Compare
added 3 commits
February 27, 2026 10:46
play_order changed from serial to integer, requiring explicit values. Add getNextPlayOrder() helper that computes max(play_order)+1 per show. Use it in addTrack, startShow, endShow, and DJ join/leave notifications.
getNextPlayOrder() was scoped per-show (WHERE show_id = X), making play_order values non-globally-unique. Queries use ORDER BY play_order DESC globally, so the sequence must be monotonically increasing across all shows to preserve correct ordering.
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.
Summary
flowsheet.play_ordercolumn type fromserialtointegerin the Drizzle schemaplay_orderis manually managed by reorder operations and should not auto-increment; the serial type wasted a PostgreSQL sequence and could collide with manually assigned valuestests/unit/database/schema.flowsheet.test.ts) that guards against regressionTest plan
serial('play_order')detected)integerwith a sequence that can be dropped separately)Fixes #19
Made with Cursor