© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
8 replies
cal

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
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to reference composite key in foreign key
Drizzle TeamDTDrizzle Team / help
2y ago
Composite Primary Key from Foreign Keys
Drizzle TeamDTDrizzle Team / help
3y ago
Do I need a foreign key?
Drizzle TeamDTDrizzle Team / help
3y ago
How to do a foreign key with cascades
Drizzle TeamDTDrizzle Team / help
2y ago