Hacker News new | ask | show | jobs
by 411111111111111 1522 days ago
> I assume that the cascading done on GitHub would be done on a FK constraint, but I'm not really sure how you'd do a "cascading soft delete" without making some kind of manual cascading logic?

Couldn't you just use an on delete trigger for this? I have no experience one the subject however

1 comments

An ON UPDATE trigger for the is_deleted column would do.

Some databases also support INSTEAD OF triggers.

Doesn't ON UPDATE only work for foreign keys? As far as I know, it's used to update the foreign key itself, and not values based on relationships.