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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 11:17:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 11:17:02 +0300
commitb39512ed755239198a9c294b6a45e65c05900235 (patch)
treed234a3efade1de67c46b9e5a38ce813627726aa7 /db/post_migrate/20220722145845_schedule_backfilling_the_namespace_id_for_vulnerability_reads.rb
parentd31474cf3b17ece37939d20082b07f6657cc79a9 (diff)
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'db/post_migrate/20220722145845_schedule_backfilling_the_namespace_id_for_vulnerability_reads.rb')
-rw-r--r--db/post_migrate/20220722145845_schedule_backfilling_the_namespace_id_for_vulnerability_reads.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/db/post_migrate/20220722145845_schedule_backfilling_the_namespace_id_for_vulnerability_reads.rb b/db/post_migrate/20220722145845_schedule_backfilling_the_namespace_id_for_vulnerability_reads.rb
new file mode 100644
index 00000000000..e2d1846f8f6
--- /dev/null
+++ b/db/post_migrate/20220722145845_schedule_backfilling_the_namespace_id_for_vulnerability_reads.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class ScheduleBackfillingTheNamespaceIdForVulnerabilityReads < Gitlab::Database::Migration[2.0]
+ MIGRATION_NAME = 'BackfillNamespaceIdOfVulnerabilityReads'
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+ disable_ddl_transaction!
+
+ def up
+ queue_batched_background_migration(
+ MIGRATION_NAME,
+ :vulnerability_reads,
+ :vulnerability_id,
+ job_interval: 2.minutes,
+ batch_size: 10_000,
+ sub_batch_size: 200
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION_NAME, :vulnerability_reads, :vulnerability_id, [])
+ end
+end