How to create one to many relationship from many to many join table in Prisma
As docs states composite ID (@@id
) cannot be defined on a relation field.
You can probably use @@unique
to define a compound unique constraint instead, like that: @unique([programId, userId])
, and then just use regular autogenerated id for ProgramEnrollment
and then you will be able to use it in a relation for UserProgram