summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-09 12:15:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-09 12:15:54 +0000
commit0c1344a7c19635e387e6f7af20591ad73f46ddff (patch)
tree2b92f62ea6e4e901127f6247a910d8f7b6f2c7c1 /db
parenta74ca2457e7c8a26ff5e12211d741b473c86c0b8 (diff)
downloadgitlab-ce-0c1344a7c19635e387e6f7af20591ad73f46ddff.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20230224144233_migrate_evidences_from_raw_metadata.rb25
-rw-r--r--db/schema_migrations/202302241442331
2 files changed, 26 insertions, 0 deletions
diff --git a/db/post_migrate/20230224144233_migrate_evidences_from_raw_metadata.rb b/db/post_migrate/20230224144233_migrate_evidences_from_raw_metadata.rb
new file mode 100644
index 00000000000..5d72a46f3c4
--- /dev/null
+++ b/db/post_migrate/20230224144233_migrate_evidences_from_raw_metadata.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+class MigrateEvidencesFromRawMetadata < Gitlab::Database::Migration[2.1]
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ MIGRATION = 'MigrateEvidencesForVulnerabilityFindings'
+ DELAY_INTERVAL = 2.minutes
+ SUB_BATCH_SIZE = 500
+ BATCH_SIZE = 10000
+
+ def up
+ queue_batched_background_migration(
+ MIGRATION,
+ :vulnerability_occurrences,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, [])
+ end
+end
diff --git a/db/schema_migrations/20230224144233 b/db/schema_migrations/20230224144233
new file mode 100644
index 00000000000..ce588827227
--- /dev/null
+++ b/db/schema_migrations/20230224144233
@@ -0,0 +1 @@
+ec6c176dc707bcaa39747fb23add886c711e075b22823174bc9f0ebee2ec224e \ No newline at end of file