summaryrefslogtreecommitdiff
path: root/db/post_migrate/20180104131052_schedule_set_confidential_note_events_on_webhooks.rb
blob: 0822aebc2c6d10c1f7078b44ffd0c50f477a6c31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class ScheduleSetConfidentialNoteEventsOnWebhooks < ActiveRecord::Migration[4.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  BATCH_SIZE = 1_000
  INTERVAL = 5.minutes

  disable_ddl_transaction!

  def up
    migration = Gitlab::BackgroundMigration::SetConfidentialNoteEventsOnWebhooks
    migration_name = migration.to_s.demodulize
    relation = migration::WebHook.hooks_to_update

    queue_background_migration_jobs_by_range_at_intervals(relation,
                                                          migration_name,
                                                          INTERVAL,
                                                          batch_size: BATCH_SIZE)
  end

  def down
  end
end