- How to build relationships between data with prisma
- Querying relationships
- Creating data with relationships
A user has one profile and a profile belongs to one user
An order has one user, a user can have many orders
Docs: https://www.prisma.io/docs/concepts/components/prisma-schema/relations/many-to-many-relations
A product can have multiple categories and a category can belong to multiple products
- Explicit m-m
- Manually create join table
- More control
- Implicit m-m
- Prisma defines join table
- Less code
A category can have a parent category and a parent category can have multiple children