summaryrefslogtreecommitdiff
path: root/db/post_migrate/20220517144749_remove_vulnerability_approval_rules.rb
blob: 83e3784c3aa3d93220429e973990739f4258d559 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

# See https://docs.gitlab.com/ee/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.

class RemoveVulnerabilityApprovalRules < Gitlab::Database::Migration[2.0]
  disable_ddl_transaction!

  restrict_gitlab_migration gitlab_schema: :gitlab_main

  class ApprovalProjectRule < MigrationRecord
    self.table_name = 'approval_project_rules'

    enum report_type: { vulnerability: 1, license_scanning: 2, code_coverage: 3, scan_finding: 4 }
  end

  def up
    return unless Gitlab.ee?

    ApprovalProjectRule.reset_column_information

    ApprovalProjectRule.vulnerability.delete_all
  end

  def down
    # no-op
    # Vulnerability-Check feature has been removed as part of 15.0
  end
end