Replace unique index in issues table (namespace_id, iid)
We currently have a unique index in the issues table index_issues_on_project_id_and_iid
. We need the equivalent using the new column namespace_id
to account for work items that are created with a NULL project_id
since they are created at the group level.
Creating issues/work_items (issues table) at the group level is gated behind the namespace_level_work_items
feature flag, so at the time of writing we only have 19 group level records in the issues table in .com and they are all test records from the group where the FF is enabled (internal)
Given the low probability of a record being created in production or any other environment with a duplicate iid
, I think it should be safe to introduce this new unique index now.
Index creation took 17.019 min i a DB clone