diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-03 03:10:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-03 03:10:17 +0300 |
commit | 1b10a6d769a97e4a2e5a65d8b7f3cb9c6d44e260 (patch) | |
tree | 4635a3a75aa34533e7148a118dfda91e4e8cdfd8 /db | |
parent | 68da8a6cb432996324a4c2fe4dca70ae260ce73f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20220802112102_schedule_migrate_shared_vulnerability_scanners.rb | 34 | ||||
-rw-r--r-- | db/schema_migrations/20220802112102 | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/db/post_migrate/20220802112102_schedule_migrate_shared_vulnerability_scanners.rb b/db/post_migrate/20220802112102_schedule_migrate_shared_vulnerability_scanners.rb new file mode 100644 index 00000000000..92ca0998bae --- /dev/null +++ b/db/post_migrate/20220802112102_schedule_migrate_shared_vulnerability_scanners.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +class ScheduleMigrateSharedVulnerabilityScanners < Gitlab::Database::Migration[2.0] + MIGRATION = "MigrateSharedVulnerabilityScanners" + TABLE_NAME = :vulnerability_occurrences + BATCH_COLUMN = :id + DELAY_INTERVAL = 5.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + BATCH_MIN_VALUE = 23658505 + BATCH_MAX_VALUE = 204428752 + + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + TABLE_NAME, + BATCH_COLUMN, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE, + batch_min_value: BATCH_MIN_VALUE, + batch_max_value: BATCH_MAX_VALUE + ) + end + + def down + delete_batched_background_migration(MIGRATION, TABLE_NAME, BATCH_COLUMN, []) + end +end diff --git a/db/schema_migrations/20220802112102 b/db/schema_migrations/20220802112102 new file mode 100644 index 00000000000..b37b29b5800 --- /dev/null +++ b/db/schema_migrations/20220802112102 @@ -0,0 +1 @@ +e5728437ae659e14906f5c0c36eea80d66e1ca056b037934b24d5a3f5489d8b7
\ No newline at end of file |