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
Summary
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
Sep 30, 2023, 04:40
As far as I know, you will need to do this manually. But let me check and make sure
safwan
Sep 30, 2023, 04:45
Yeah I think you will need to create a helper function that removes the children.
safwan
Sep 30, 2023, 04:46
Although, to be absolutely sure, you could create a dummy collection with relations, and test it out!
ZachHandley
Moderator
Sep 30, 2023, 06:09
gotcha!
ZachHandley
Moderator
Sep 30, 2023, 06:09
thank you!
ZachHandley
Moderator
Sep 30, 2023, 06:09
I did haha, I was just curious to know an absolute L)
ZachHandley
Moderator
Sep 30, 2023, 06:09
🙂
ZachHandley
Moderator
Sep 30, 2023, 06:09
thank you!
ZachHandley
Moderator
Sep 30, 2023, 06:09
ZachHandley
Moderator
Sep 30, 2023, 06:09
[SOLVED] Do I need to Delete Children Individually with Cascade Delete One to Many?