Referential integrity and cascading deletes

Hi all.
I’d like to connect a notes table to jobs table, so that any job can have multiple notes attached. So far - so good. I have connected the two tables in a one to many relationship and all goes well, but when I delete a parent record that has one or more child records, the parent (job) gets deleted but not the connected child (note) records. Instead of being deleted as I had expected, the attached notes have the connecting field blanked and they remain.

Is there a way to have the dependent child pages automatically deleted when the parent records are deleted as is standard practice with relational databases?

1 Like

Hey @MarkC! Welcome to the community!

This comes up a bunch espeically with clients who are familiar wtih database architcure. At Tadabase we have a unique way we deal with the relationship and therefore don’t cascade delete records ever.

What we recommend is to filter these notes and manually delete any records that are orphaned. Another option is to soft delete the Job (new field that gets marked as deleted), then create a record rule that will update the connected Notes and mark them as deletable.

Let me know if I can clarify anything further.

I agree on this request. At least it should be optional. What’s the reason to keep records that lost relationship with parent and can not be reached other than directly?
In fact if you want to comply with GDRP in EU and user wants to delete own data, when deleting user, all related data with that user should be deleted. So this is a necesary functionlality to comply GDPR in EU.
@moe, Is there any way to delete all conected records with a user, other than manual delete?
If user deletes own access, I should have a log, and after a user delete, then manually delete all records related to that user… I don’t find it workable. I think I have read someone that found a way, but can not find related post.