Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2019-07-12 16:16:08 +0300
committerAndreas Brandl <abrandl@gitlab.com>2019-07-12 16:16:08 +0300
commit5ea899d34f6332733bb5aee225c5f3ced340cb24 (patch)
treefd5c031223b2eeb34942fc3c5d3421619f1ce22e /lib/gitlab/background_migration
parent907154957ef89c1f0df1de3c665418146cc93f98 (diff)
parent184807b253991bc0aed20cad038c6d6602b5dba8 (diff)
Merge branch 'id-clean-up-mr-assignees-migration' into 'master'
Add cleanup migration for MR's multiple assignees See merge request gitlab-org/gitlab-ce!30269
Diffstat (limited to 'lib/gitlab/background_migration')
-rw-r--r--lib/gitlab/background_migration/populate_merge_request_assignees_table.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/background_migration/populate_merge_request_assignees_table.rb b/lib/gitlab/background_migration/populate_merge_request_assignees_table.rb
index a4c6540c61b..eb4bc0aaf28 100644
--- a/lib/gitlab/background_migration/populate_merge_request_assignees_table.rb
+++ b/lib/gitlab/background_migration/populate_merge_request_assignees_table.rb
@@ -18,6 +18,14 @@ module Gitlab
execute("INSERT INTO merge_request_assignees (merge_request_id, user_id) #{select_sql}")
end
+ def perform_all_sync(batch_size:)
+ MergeRequest.each_batch(of: batch_size) do |batch|
+ range = batch.pluck('MIN(id)', 'MAX(id)').first
+
+ perform(*range)
+ end
+ end
+
private
def merge_request_assignees_not_exists_clause