I have a table Category with a parent_id column referencing the self id column, for this, I used "ON DELETE CASCADE" meaning if the parent is deleted, other children would be deleted too.
At the same table I have a boolean column active, is it possible to use ON UPDATE CASCADE in order to make the update of this column impact recursively all the children of the updated row?
let's take this example parent > sub1 > sub2, what is the way (at the database level) to make the update of the column active impact all the children?
- update the parent will impact himself and sub1 and sub2
- update the sub1 will impact himself and the sub2.
and so on.
Thanks in advance.