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
Alfred Noland
05/04/2022, 8:58 AM
Thanks, what kind of many to many relation, explicit or implicit?
Alfred Noland
05/04/2022, 9:02 AM
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
Anders
05/04/2022, 9:38 AM
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
Alfred Noland
05/04/2022, 9:41 AM
Okey so you dont recommend to do it with Prisma explicit/implicit many to many?