Prisma 2 relations to the same model
Hi, I'm working with Prisma for the first time, and I'm having trouble with a relation:
I have a Transfer and a Deposit model, but the Transfer has a from and a to relation both relating to the Deposit how can I implement this?
schema.prisma:
full schema.prisma: https://pastecord.com/upuxegexeg.prisma
3 Replies
Prisma
Relations (Reference)
A relation is a connection between two models in the Prisma schema. This page explains how you can define one-to-one, one-to-many and many-to-many relations in Prisma.
TLDR; you need to define names for each of the relations and reference them
Thanks