Prisma, self relation onDelete, onUpdate behavior
I have a prisma model:
I want to add onDelete: Cascade or onUpdate: Cascade, but it returns an error:
Error validating: A self-relation must have
onDelete
and onUpdate
referential actions set to NoAction
in one of the @relation attributes. (Implicit default onDelete
: SetNull
, and onUpdate
: Cascade
) Read more at https://pris.ly/d/cyclic-referential-actionsPrisma
Special rules for referential actions in SQL Server and MongoDB
Circular references or multiple cascade paths can cause validation errors on Microsoft SQL Server and MongoDB. Since the database does not handle these situations out of the box, learn how to solve this problem.
2 Replies