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
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-06 00:09:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-06 00:09:04 +0300
commit96e23b2017cbe56969771960f6c274c5d3599397 (patch)
treeb8b17da1ab080dd41fc64fc0262de2cf16754559 /db
parent2f1a81fd16ff9968d6b986f8a407d963bc2218f9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb16
-rw-r--r--db/post_migrate/20230522111534_reschedule_migration_for_links_from_metadata.rb32
-rw-r--r--db/schema_migrations/202305221115341
3 files changed, 35 insertions, 14 deletions
diff --git a/db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb b/db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb
index 9c6213c60ee..8449acb33e1 100644
--- a/db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb
+++ b/db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-# rubocop: disable BackgroundMigration/MissingDictionaryFile
-
class RescheduleLinksAvoidingDuplication < Gitlab::Database::Migration[2.1]
MIGRATION = 'MigrateLinksForVulnerabilityFindings'
DELAY_INTERVAL = 2.minutes
@@ -13,20 +11,10 @@ class RescheduleLinksAvoidingDuplication < Gitlab::Database::Migration[2.1]
restrict_gitlab_migration gitlab_schema: :gitlab_main
def up
- delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, [])
-
- queue_batched_background_migration(
- MIGRATION,
- :vulnerability_occurrences,
- :id,
- job_interval: DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- sub_batch_size: SUB_BATCH_SIZE
- )
+ # no-op as it is rescheduled via db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb
end
def down
- delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, [])
+ # no-op as it is rescheduled via db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb
end
end
-# rubocop: enable BackgroundMigration/MissingDictionaryFile
diff --git a/db/post_migrate/20230522111534_reschedule_migration_for_links_from_metadata.rb b/db/post_migrate/20230522111534_reschedule_migration_for_links_from_metadata.rb
new file mode 100644
index 00000000000..d351d795ddf
--- /dev/null
+++ b/db/post_migrate/20230522111534_reschedule_migration_for_links_from_metadata.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+# rubocop: disable BackgroundMigration/MissingDictionaryFile
+
+class RescheduleMigrationForLinksFromMetadata < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'MigrateLinksForVulnerabilityFindings'
+ DELAY_INTERVAL = 2.minutes
+ SUB_BATCH_SIZE = 500
+ BATCH_SIZE = 4000
+
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, [])
+
+ 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
+# rubocop: enable BackgroundMigration/MissingDictionaryFile
diff --git a/db/schema_migrations/20230522111534 b/db/schema_migrations/20230522111534
new file mode 100644
index 00000000000..72d0719a93f
--- /dev/null
+++ b/db/schema_migrations/20230522111534
@@ -0,0 +1 @@
+99c1d226ac26e20e8cb1ad43663cad4e9e2cc296d8a76914b2fe402ff3674b24 \ No newline at end of file