Welcome to mirror list, hosted at ThFree Co, Russian Federation.

delete_orphans_approval_merge_request_rules.rb « background_migration « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e77d56d68cb94e9e18ac98fb0d4f80075efeea96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Gitlab
  module BackgroundMigration
    # Deletes orphans records whenever report_type equals to scan_finding (i.e., 4)
    class DeleteOrphansApprovalMergeRequestRules < BatchedMigrationJob
      scope_to ->(relation) { relation.where(report_type: 4) }

      operation_name :delete_all
      feature_category :database

      def perform
        each_sub_batch do |sub_batch|
          sub_batch.where(security_orchestration_policy_configuration_id: nil).delete_all
        end
      end
    end
  end
end