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:
Diffstat (limited to 'db/post_migrate/20200207185149_schedule_fix_orphan_promoted_issues.rb')
-rw-r--r--db/post_migrate/20200207185149_schedule_fix_orphan_promoted_issues.rb35
1 files changed, 0 insertions, 35 deletions
diff --git a/db/post_migrate/20200207185149_schedule_fix_orphan_promoted_issues.rb b/db/post_migrate/20200207185149_schedule_fix_orphan_promoted_issues.rb
deleted file mode 100644
index d25d6ed2dc7..00000000000
--- a/db/post_migrate/20200207185149_schedule_fix_orphan_promoted_issues.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleFixOrphanPromotedIssues < ActiveRecord::Migration[5.2]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- BATCH_SIZE = 100
- BACKGROUND_MIGRATION = 'FixOrphanPromotedIssues'
-
- disable_ddl_transaction!
-
- class Note < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'notes'
-
- scope :of_promotion, -> do
- where(noteable_type: 'Issue')
- .where('notes.system IS TRUE')
- .where("notes.note LIKE 'promoted to epic%'")
- end
- end
-
- def up
- Note.of_promotion.each_batch(of: BATCH_SIZE) do |notes, index|
- jobs = notes.map { |note| [BACKGROUND_MIGRATION, [note.id]] }
-
- BackgroundMigrationWorker.bulk_perform_async(jobs)
- end
- end
-
- def down
- # NO OP
- end
-end