Skip to content

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

Open
jakebromberg wants to merge 2 commits intomainfrom
fix/21-show-djs-unique
Open

fix: add unique constraint on show_djs (show_id, dj_id)#195
jakebromberg wants to merge 2 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

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 1adb273 to a695b5e Compare February 27, 2026 05:56
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.

1 participant