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

20201029144444_create_vulnerability_finding_links.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 225a2de6e194887dedd1e906d5b9b0b01fd963f1 (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
# frozen_string_literal: true

class CreateVulnerabilityFindingLinks < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    create_table :vulnerability_finding_links, if_not_exists: true do |t|
      t.timestamps_with_timezone null: false
      t.references :vulnerability_occurrence, index: { name: 'finding_links_on_vulnerability_occurrence_id' }, null: false, foreign_key: { on_delete: :cascade }
      t.text :name
      t.text :url, null: false
    end

    add_text_limit :vulnerability_finding_links, :name, 255
    add_text_limit :vulnerability_finding_links, :url, 2048
  end

  def down
    drop_table :vulnerability_finding_links
  end
end