Skip to content

Clean self references before deleting records

When deleting a full branch of a tree, if the number of records deleted is higher than IN_MAX, the foreign key constraint may prevent the deletion because the group of records deleted may still be referencing a record in the next group to delete. To prevent this failure, we must first clean the values of the column with foreign key referencing the same table. We use the table id as value instead of NULL in case the column is not nullable.

Merge request reports

Loading