Quick question: If I got 2 models (User & Fruit) and I want Users to be able to share what Fruit they like (i.e. User1 likes Apples User2 likes Apples and Banana), how exactly would you do so? I'm unsure if it's an One-to-Many or Many-to-Many I need here
s
Shaul Zuarets
02/03/2022, 9:09 PM
Many to many, behind the scene you would need another table. Table example:
[id][userId][FruitId]
g
Greger gregerson
02/03/2022, 9:12 PM
Aha! Thanks a bunch! Would the example provided by prisma be good enough?
s
Shaul Zuarets
02/03/2022, 9:27 PM
Sorry, not familiar with that example, however, I’m sure it will.