How do I define a composite foreign key?

Similar to this syntax in prisma?
%field% %Type% @relation(fields: [id, objectType], references: [objectId, objectType])
%field% %Type% @relation(fields: [id, objectType], references: [objectId, objectType])
I saw the section about composite primary keys but I didn't find anything about composite foreign keys. Thank you in advance
5 Replies
Andrii Sherman
we have a docs section for it and if you want to have composite FK just scroll down a bot in a link I've sent
Andrii Sherman
The example is not a realworld case, but it shows how syntax looks like
FullSendShen
FullSendShen13mo ago
Can that composite foreign key also be the primary key? @Andrew Sherman
Want results from more Discord servers?
Add your server