Enhanced Epic Deletion Protection
Release notes
We've updated our epic deletion process to safeguard your project's structure and data better. Now, when you delete a parent Epic, instead of deleting all its child records automatically, we preserve them by detaching the parent relationship first. This change provides you with a safer way to manage your epics, ensuring accidental deletions don't result in losing valuable information. It's all about giving you more control and peace of mind while managing your projects.
Summary
When deleting an epic its children are also deleted because we have a foreign key with cascade on delete for the parent_id
column:
ActiveRecord::Base.connection.foreign_keys(:epics).find{ |fk| fk.options[:column] == "parent_id"}
=> #<Struct:ActiveRecord::ConnectionAdapters::ForeignKeyDefinition:0x00039170
from_table = :epics,
options = {
:column => "parent_id",
:name => "fk_25b99c1be3",
:primary_key => "id",
:on_delete => :cascade,
:on_update => nil,
:deferrable => false,
:validate => true
},
to_table = "epics"
>
We want to change this behaviour so children are not deleted and the parent_id
column is nullified. We also need to update the documentation https://docs.gitlab.com/ee/user/group/epics/manage_epics.html#delete-an-epic.