.wasp not recognising disambiguating relations
I have tried to define one-to-many relation between entities
I have defined relation name following docs: https://www.prisma.io/docs/orm/prisma-schema/data-model/relations#disambiguating-relations
But when i run
I realized that auto generated
User and PurchaseRequest. Here is schema:entity User {=psl
///
purchaseRequestsCreated PurchaseRequest[] @relation(name: "createdBy")
purchaseRequestsProcessed PurchaseRequest[] @relation(name: "processedBy")
psl=}
entity PurchaseRequest {=psl
///
author User @relation(name: "createdBy", fields: [authorId], references: [id])
authorId Int
processedBy User @relation(name: "processedBy", fields: [processedById], references: [id])
processedById Int
psl=}I have defined relation name following docs: https://www.prisma.io/docs/orm/prisma-schema/data-model/relations#disambiguating-relations
But when i run
wasp db migrate-dev i got error from comment.I realized that auto generated
schema.prisma in .wasp/out/db does not contain @relation(name). After modifying that file and adding needed relations it works. I can't understand whether I made a mistake in defining the relationships or what is the reason why I can't define relationships within the WASP file so that they are successfully processed?Prisma
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.
