Skip to content

Composite key on n:m relation table #1999

Answered by janpio
ff-anthony-soto asked this question in Q&A
Discussion options

You must be logged in to vote

Should both muscle and exercise in MuscleExercis both be unique individually (which is how it is modeled right now) or as a compound unique? If the latter, you should try @@unique([muscle, execrise]) - that should be treated as the unique identifier for that model.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ff-anthony-soto
Comment options

Answer selected by ff-anthony-soto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants