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/gitlab/background_migration/backfill_internal_on_notes.rb')
-rw-r--r--lib/gitlab/background_migration/backfill_internal_on_notes.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/gitlab/background_migration/backfill_internal_on_notes.rb b/lib/gitlab/background_migration/backfill_internal_on_notes.rb
new file mode 100644
index 00000000000..300f2cff6ca
--- /dev/null
+++ b/lib/gitlab/background_migration/backfill_internal_on_notes.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module BackgroundMigration
+ # This syncs the data to `internal` from `confidential` as we rename the column.
+ class BackfillInternalOnNotes < BatchedMigrationJob
+ scope_to -> (relation) { relation.where(confidential: true) }
+
+ def perform
+ each_sub_batch(operation_name: :update_all) do |sub_batch|
+ sub_batch.update_all(internal: true)
+ end
+ end
+ end
+ end
+end