Entity と Taransaction の 2 つのモデル間に多対多の関係を作成しようとしています。
model Entity {
id String @id @default(cuid())
name String
purchases Transactions[] // references the source field on Transaction
sales Transaction[] // references the destination field on Transaction
}
model Transaction {
source Entity
destination Entity
amount Float
date DateTime @default(now())
}
私が望むのは、トランザクションのソースを指すすべてのエンティティの購入と、トランザクションの宛先を指すすべてのエンティティの販売を取得できるようにすることです。
私の質問は、Prisma 2 を使用すると、この関係のスキーマはどのようになるかということです。