summaryrefslogtreecommitdiff
path: root/db/post_migrate/20180122154930_schedule_set_confidential_note_events_on_services.rb
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-04-07 10:08:34 +0100
committerPhil Hughes <me@iamphill.com>2018-04-07 10:08:34 +0100
commit4581a78d66a93c6d82b39d1214b75e15681a9960 (patch)
tree4fecac73aba986ddcce6a82515bf7775d212f986 /db/post_migrate/20180122154930_schedule_set_confidential_note_events_on_services.rb
parent690c57867d6dcaaaee15208e9d4de6ec85f19e80 (diff)
parent671e93dc38365f3b05cb3cfe719e64713196be31 (diff)
downloadgitlab-ce-4581a78d66a93c6d82b39d1214b75e15681a9960.tar.gz
Merge branch 'master' into ide-staged-changes
Diffstat (limited to 'db/post_migrate/20180122154930_schedule_set_confidential_note_events_on_services.rb')
-rw-r--r--db/post_migrate/20180122154930_schedule_set_confidential_note_events_on_services.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/db/post_migrate/20180122154930_schedule_set_confidential_note_events_on_services.rb b/db/post_migrate/20180122154930_schedule_set_confidential_note_events_on_services.rb
new file mode 100644
index 00000000000..a3ff9f1719e
--- /dev/null
+++ b/db/post_migrate/20180122154930_schedule_set_confidential_note_events_on_services.rb
@@ -0,0 +1,23 @@
+class ScheduleSetConfidentialNoteEventsOnServices < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ BATCH_SIZE = 1_000
+ INTERVAL = 20.minutes
+
+ disable_ddl_transaction!
+
+ def up
+ migration = Gitlab::BackgroundMigration::SetConfidentialNoteEventsOnServices
+ migration_name = migration.to_s.demodulize
+ relation = migration::Service.services_to_update
+
+ queue_background_migration_jobs_by_range_at_intervals(relation,
+ migration_name,
+ INTERVAL,
+ batch_size: BATCH_SIZE)
+ end
+
+ def down
+ end
+end