© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•12mo ago•
44 replies
Frost7994

Disambiguating relations

Hi guys, started using drizzle and love it but ran into an issue when moving from Prisma to drizzle with relations.

I have two tables, Users and Classes. The user table has the fields id, name, username, email and role enum which is either student or teacher. The class table has the fields id and name. For the relations I want the class to have many students and many teachers and for the user they can be a teacher of many classes but only a student to one class. How can I create the tables and relations to reflect this? Any help would be appreciated
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

1:1 disambiguating relations on parent
Drizzle TeamDTDrizzle Team / help
14mo ago
Defining disambiguating one-to-one relational query
Drizzle TeamDTDrizzle Team / help
2y ago
Extending Relations
Drizzle TeamDTDrizzle Team / help
2y ago
Querying relations
Drizzle TeamDTDrizzle Team / help
2y ago