This message was deleted.
# orm-help
s
This message was deleted.
a
Yes. A many-to-many relationship refers to a relationship between tables in a database when a parent row in one table contains several child rows in the second table, and vice versa. So: Home1 -> Kitchen -> Livingroom Home2 -> Kitchen -> Pool Or the other way around: Kitchen -> Home1 -> Home2
a
Thanks, what kind of many to many relation, explicit or implicit?
Example of models: model Home { id Int name String facilities relation to facility } model Facility{ id Int name String } Since there is only one field in the Home model where facility is referenced.
a
I'm not entirely sure what you are after but the model can differ depending on implementation tech I guess. In a relational world if you want to be able to query the data from both ends you normally implement a relational table where the id:s of the different tables resides. Home • id • name Facility • Id • Name Relation_Home_Facility • id • home_Id • facility_Id Maybe I understand your question the wrong way.
a
Okey so you dont recommend to do it with Prisma explicit/implicit many to many?
a
I'd say it depends on your use case. Both have pros and cons. Read the docs: https://www.prisma.io/docs/concepts/components/prisma-schema/relations/many-to-many-relations They are good in explaining this I'd say.