I’m currently encountering an error when trying to delete a node. The node has a relation with another node which is one of its fields. This other node has a relation with yet another node through one of its fields. See the image below.
Hence, when I try to delete a Hunt, since onDelete is set to Cascade, it should the associated Phase. But here’s when the problem arises. When it tries to delete the associated Phase, the relation between the Phase and its Interaction doesn’t allow the Phase to be deleted arising to the error:
“The change you are trying to make would violate the required relation ‘PhaseInteraction’ between Interaction and Phase”.
This is probably because the onDelete for the Phase isn’t triggered due to the fact that it was deleted by the onDelete for the Hunt, and not from a normal prisma delete.
Is there any way I can bypass this?