blob: f88e3a5ee0975467f97930d32fb3461d99048e6e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# frozen_string_literal: true
# See https://docs.gitlab.com/ee/development/database/batched_background_migrations.html
# for more information on how to use batched background migrations
# Update below commented lines with appropriate values.
module EE
module Gitlab
module BackgroundMigration
module MyBatchedMigration
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
prepended do
# operation_name :my_operation # This is used as the key on collecting metrics
# scope_to ->(relation) { relation.where(column: "value") }
end
override :perform
def perform
each_sub_batch do |sub_batch|
# Your action on each sub_batch
end
end
end
end
end
end
|