diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 15:57:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 15:57:54 +0300 |
commit | 419c53ec62de6e97a517abd5fdd4cbde3a942a34 (patch) | |
tree | 1f43a548b46bca8a5fb8fe0c31cef1883d49c5b6 /db/post_migrate/20230721095222_delete_orphans_scan_finding_license_scanning_approval_rules2.rb | |
parent | 1da20d9135b3ad9e75e65b028bffc921aaf8deb7 (diff) |
Add latest changes from gitlab-org/gitlab@16-5-stable-eev16.5.0-rc42
Diffstat (limited to 'db/post_migrate/20230721095222_delete_orphans_scan_finding_license_scanning_approval_rules2.rb')
-rw-r--r-- | db/post_migrate/20230721095222_delete_orphans_scan_finding_license_scanning_approval_rules2.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/db/post_migrate/20230721095222_delete_orphans_scan_finding_license_scanning_approval_rules2.rb b/db/post_migrate/20230721095222_delete_orphans_scan_finding_license_scanning_approval_rules2.rb new file mode 100644 index 00000000000..cc8c0affdea --- /dev/null +++ b/db/post_migrate/20230721095222_delete_orphans_scan_finding_license_scanning_approval_rules2.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +class DeleteOrphansScanFindingLicenseScanningApprovalRules2 < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MERGE_REQUEST_MIGRATION = 'DeleteOrphansApprovalMergeRequestRules2' + PROJECT_MIGRATION = 'DeleteOrphansApprovalProjectRules2' + INTERVAL = 2.minutes + + def up + queue_batched_background_migration( + PROJECT_MIGRATION, + :approval_project_rules, + :id, + job_interval: INTERVAL, + batch_size: 500, + sub_batch_size: 100 + ) + + queue_batched_background_migration( + MERGE_REQUEST_MIGRATION, + :approval_merge_request_rules, + :id, + job_interval: INTERVAL, + batch_size: 2500, + sub_batch_size: 500 + ) + end + + def down + delete_batched_background_migration(PROJECT_MIGRATION, :approval_project_rules, :id, []) + delete_batched_background_migration(MERGE_REQUEST_MIGRATION, :approval_merge_request_rules, :id, []) + end +end |