Back

[SOLVED] Do I need to Delete Children Individually with Cascade Delete One to Many?

  • 0
  • Self Hosted
ZachHandley
30 Sep, 2023, 03:28

Before you assume the answer, I'm aware if I delete the parent it'll delete the children, but I want to know if I can update the parent, and then it'll auto-delete the children πŸ˜„ -- it would make sense if it didn't but I'm getting a server error trying to do it (my N8N package so can't tell the exact error) so I wanted to check if I could

TL;DR
Solution: No, you do not need to delete children individually with Cascade Delete One to Many. When you delete the parent, the children will be deleted automatically. However, updating the parent will not trigger the automatic deletion of children. If you are experiencing a server error while trying to update the parent, there may be another issue causing the problem.
safwan
30 Sep, 2023, 04:40

As far as I know, you will need to do this manually. But let me check and make sure

safwan
30 Sep, 2023, 04:45

Yeah I think you will need to create a helper function that removes the children.

safwan
30 Sep, 2023, 04:46

Although, to be absolutely sure, you could create a dummy collection with relations, and test it out!

ZachHandley
30 Sep, 2023, 06:09

gotcha!

ZachHandley
30 Sep, 2023, 06:09

thank you!

ZachHandley
30 Sep, 2023, 06:09

I did haha, I was just curious to know an absolute L)

ZachHandley
30 Sep, 2023, 06:09

πŸ™‚

ZachHandley
30 Sep, 2023, 06:09

thank you!

ZachHandley
30 Sep, 2023, 06:09
ZachHandley
30 Sep, 2023, 06:09

[SOLVED] Do I need to Delete Children Individually with Cascade Delete One to Many?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more