Skip to content

fix: add unique constraint on show_djs (show_id, dj_id)#195

Merged
jakebromberg merged 3 commits intomainfrom
fix/21-show-djs-unique
Mar 10, 2026
Merged

fix: add unique constraint on show_djs (show_id, dj_id)#195
jakebromberg merged 3 commits intomainfrom
fix/21-show-djs-unique

Conversation

@jakebromberg
Copy link
Member

@jakebromberg jakebromberg commented Feb 21, 2026

Summary

  • Adds a composite uniqueIndex on (show_id, dj_id) to the show_djs junction table to prevent duplicate DJ-show pairings
  • Adds a schema assertion unit test that verifies the unique index exists

Test plan

  • New unit test schema.show-djs.test.ts fails before the fix and passes after
  • Existing unit tests pass (npm run test:unit)
  • Integration tests pass against a running database

Closes #21

Made with Cursor

Note: This fix is consolidated in #199 (coordinated schema migration batch). Consider closing in favor of #199.

Jake Bromberg and others added 3 commits March 9, 2026 20:51
The junction table had no uniqueness constraint, allowing a DJ to be
inserted into the same show multiple times.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jakebromberg jakebromberg force-pushed the fix/21-show-djs-unique branch from c16f272 to 0360e00 Compare March 10, 2026 03:51
@jakebromberg jakebromberg merged commit 274923b into main Mar 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants