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

20230123095023_add_scan_result_policy_id_to_software_license_policies.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7f61b3bfe8533c565152058f77f2c8303c8203f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class AddScanResultPolicyIdToSoftwareLicensePolicies < Gitlab::Database::Migration[2.1]
  INDEX_NAME = "index_software_license_policies_on_scan_result_policy_id"

  def change
    # rubocop:disable Migration/AddReference
    add_reference :software_license_policies,
                  :scan_result_policy,
                  foreign_key: { on_delete: :cascade },
                  index: { name: INDEX_NAME },
                  null: true
    # rubocop:enable Migration/AddReference
  end
end