Since it cannot perform two actions in the same table together:
- remove the parent.
- update children.
A mutation table is a table that is modified using an UPDATE, DELETE, or INSERT statement, or a table that can be updated with the effects of the DELETE CASCADE constraint.
you can overcome this manually by creating a procedure that holds the parent key to delete the entry and set the children to NULL.
procedure(parent_id) --takes the id as a parameter update table set null where foreign_key = parent_id; delete from table where id = parent_id; end;
source share