Is it possible to do the reverse operation of dele...
# orm-help
v
Is it possible to do the reverse operation of deleting all nested relationships? Basically my create relationship looks like this:
Copy code
{
    name: "yeye",
    description: "yaya",
    rows: {
      create: [
        { columns: { create: [{ type: "Text", content: "text 1" }, { type: "Image", content: "" }] } },
        { columns: { create: [{ type: "Text", content: "text 2" }, { type: "Text", content: "text 3" }, { type: "Text", content: "text 4" }] } }
      ]
    }
  }
(Pretty much I want to wipe everything and just re-create everything on update, instead of trying to do a delta of existing/non-existing, plus handling deleting etc… to me the deletion was a simpler)
e
I'm not sure I understand your question, but if you want to delete wipe all the children: you can use the @relation directive as follows:
@relation(name:"...", onDelete: CASCADE)
. Docs: https://www.prisma.io/docs/reference/service-configuration/data-model/data-modelling-(sdl)-eiroozae8u#the-@relation-directive
👍 1