Add and backfill project_id for deployment_merge_requests
What does this MR do and why?
Add and backfill project_id for deployment_merge_requests.
- This is a table with non unique composite primary keys
"deployment_merge_requests_pkey" PRIMARY KEY, btree (deployment_id, merge_request_id) - We have used cursor based batching
- Skipping addition of FK due to table size and it has
"fk_rails_dcbce9f4df" FOREIGN KEY (deployment_id) REFERENCES deployments(id) ON DELETE CASCADEand indeployments(parent table):"fk_b9a3851b82" FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
Once the background migration has completed, a second merge request will be created to finalize the background migration and validate the not null constraint.
Similar MRs: !183047 (merged)
Related to #493768 (closed)
Edited by Shubham Kumar