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:
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.rb34
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