summaryrefslogtreecommitdiff
path: root/db/post_migrate/20190702173936_populate_remaining_merge_request_assignees.rb
diff options
context:
space:
mode:
authorIgor Drozdov <idrozdov@gitlab.com>2019-07-02 17:42:58 +0300
committerIgor Drozdov <idrozdov@gitlab.com>2019-07-09 12:13:55 +0300
commit184807b253991bc0aed20cad038c6d6602b5dba8 (patch)
treefd6f78064cb5926a65a8892e352464c47fb64d64 /db/post_migrate/20190702173936_populate_remaining_merge_request_assignees.rb
parent775910d3726007c94c74e49f3f243464e50d65f0 (diff)
downloadgitlab-ce-184807b253991bc0aed20cad038c6d6602b5dba8.tar.gz
Add cleanup migration for MR's mutliple assigneesid-clean-up-mr-assignees-migration
The migration steals the remaining background jobs of populating MRs with assignees, executes them synchronously and then makes sure that all the assignees are migrated
Diffstat (limited to 'db/post_migrate/20190702173936_populate_remaining_merge_request_assignees.rb')
-rw-r--r--db/post_migrate/20190702173936_populate_remaining_merge_request_assignees.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/db/post_migrate/20190702173936_populate_remaining_merge_request_assignees.rb b/db/post_migrate/20190702173936_populate_remaining_merge_request_assignees.rb
new file mode 100644
index 00000000000..c435b94015d
--- /dev/null
+++ b/db/post_migrate/20190702173936_populate_remaining_merge_request_assignees.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class PopulateRemainingMergeRequestAssignees < ActiveRecord::Migration[5.1]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ BATCH_SIZE = 10_000
+ MIGRATION = 'PopulateMergeRequestAssigneesTable'
+
+ disable_ddl_transaction!
+
+ def up
+ Gitlab::BackgroundMigration.steal(MIGRATION)
+
+ Gitlab::BackgroundMigration::PopulateMergeRequestAssigneesTable.new.perform_all_sync(batch_size: BATCH_SIZE)
+ end
+end