Add multiple MR assignees migration and background table population
What does this MR do?
- Add migration required for multiple assignees
- Add post-deployment migration which schedules batches background migrations to insert
merge_request_assignees
rows - Add a
after_save
callback to keepmerge_request_assignees
in sync while the migrations doesn't finishes and the codebase is still not using the relation
EE-port https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10411
Query generated on background migration
INSERT INTO merge_request_assignees (merge_request_id, user_id)
SELECT "merge_requests"."id",
"merge_requests"."assignee_id"
FROM "merge_requests"
WHERE (NOT EXISTS
(SELECT 1
FROM merge_request_assignees
WHERE (merge_request_assignees.merge_request_id = merge_requests.id) )
AND ("merge_requests"."id" BETWEEN 1 AND 4)
AND (assignee_id IS NOT NULL)
What are the relevant issue numbers?
Part of https://gitlab.com/gitlab-org/gitlab-ee/issues/2004
Does this MR meet the acceptance criteria?
- [ ] Changelog entry added, if necessary
-
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer
Edited by Oswaldo Ferreira