Sync epics parent_id and relative position to work items
Epics table have parent_id
and relative_position
fields these are used to show an ordered list of child epics.
As part of the migration of epics to work items we need to migrate data from these columns into a new widget for work items which holds data at work_item_parent_links
.
Proposal
- Whenever a new parent is assigned to an epic we verify if both parent and child already have associated work items created. If not we skip the next steps.
- Create a new record at
work_item_parent_links
by copying:-
legacy_epic.parent.issue_id
towork_item_parent_links.work_item_parent_id
-
legacy_epic.relative_position
towork_item_parent_links.relative_position
-
legacy_epic.issue_id
towork_item_parent_links.work_item_id
-
- When a child epic is removed from its parent we destroy the same record at
work_item_parent_links
where:-
work_item_parent_links.work_item_id
is equal tochild_epic.issue_id
-
work_item_parent_links.work_item_parent_id
is equal tochild_epic.parent.issue_id
-
- Backfill
work_item_parent_tables
using background migration following the same logic from step 2.
Edited by Eugenia Grieff