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 'lib/generators/batched_background_migration/templates/ee_batched_background_migration_job.template')
-rw-r--r--lib/generators/batched_background_migration/templates/ee_batched_background_migration_job.template29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/generators/batched_background_migration/templates/ee_batched_background_migration_job.template b/lib/generators/batched_background_migration/templates/ee_batched_background_migration_job.template
new file mode 100644
index 00000000000..b36fc216acd
--- /dev/null
+++ b/lib/generators/batched_background_migration/templates/ee_batched_background_migration_job.template
@@ -0,0 +1,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 <%= class_name %>
+ extend ActiveSupport::Concern
+ extend ::Gitlab::Utils::Override
+
+ prepended do
+ # operation_name :my_operation
+ # 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