diff options
Diffstat (limited to 'db/migrate/20211117174209_create_vulnerability_reads.rb')
-rw-r--r-- | db/migrate/20211117174209_create_vulnerability_reads.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/db/migrate/20211117174209_create_vulnerability_reads.rb b/db/migrate/20211117174209_create_vulnerability_reads.rb new file mode 100644 index 00000000000..b9e32bfd0fa --- /dev/null +++ b/db/migrate/20211117174209_create_vulnerability_reads.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class CreateVulnerabilityReads < Gitlab::Database::Migration[1.0] + def change + create_table :vulnerability_reads do |t| + t.bigint :vulnerability_id, null: false + t.bigint :project_id, null: false + t.bigint :scanner_id, null: false + t.integer :report_type, limit: 2, null: false + t.integer :severity, limit: 2, null: false + t.integer :state, limit: 2, null: false + t.boolean :has_issues, default: false, null: false + t.boolean :resolved_on_default_branch, default: false, null: false + t.uuid :uuid, null: false + t.text :location_image, limit: 2048 + + t.index :vulnerability_id, unique: true + t.index :scanner_id + t.index :uuid, unique: true + t.index [:project_id, :state, :severity, :vulnerability_id], name: :index_vuln_reads_on_project_id_state_severity_and_vuln_id, order: { vulnerability_id: :desc } + t.index :location_image, where: "report_type IN (2, 7)", name: :index_vulnerability_reads_on_location_image + end + end +end |