2020-10-16 15:08:46 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class ScheduleBlockedByLinksReplacement < ActiveRecord::Migration[6.0]
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
INTERVAL = 2.minutes
|
|
|
|
# at the time of writing there were 47600 blocked_by issues:
|
|
|
|
# estimated time is 48 batches * 2 minutes -> 100 minutes
|
|
|
|
BATCH_SIZE = 1000
|
|
|
|
MIGRATION = 'ReplaceBlockedByLinks'
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
class IssueLink < ActiveRecord::Base
|
|
|
|
include EachBatch
|
|
|
|
|
|
|
|
self.table_name = 'issue_links'
|
|
|
|
end
|
|
|
|
|
|
|
|
def up
|
2020-11-11 03:08:57 +00:00
|
|
|
# no-op
|
|
|
|
# superseded by db/post_migrate/20201102073808_schedule_blocked_by_links_replacement_second_try.rb
|
2020-10-16 15:08:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
end
|
|
|
|
end
|