Commit 5dba476d authored by Mehmet Emin INAC's avatar Mehmet Emin INAC

Wrap table creation to guard clause

parent 98f471c6
...@@ -8,12 +8,14 @@ class CreateSecurityFindingsTable < ActiveRecord::Migration[6.0] ...@@ -8,12 +8,14 @@ class CreateSecurityFindingsTable < ActiveRecord::Migration[6.0]
disable_ddl_transaction! disable_ddl_transaction!
def up def up
create_table :security_findings, if_not_exists: true do |t| unless table_exists?(:security_findings)
t.references :scan, null: false create_table :security_findings do |t|
t.references :scanner, null: false t.references :scan, null: false
t.integer :severity, limit: 2, index: true, null: false t.references :scanner, null: false
t.integer :confidence, limit: 2, index: true, null: false t.integer :severity, limit: 2, index: true, null: false
t.text :project_fingerprint, index: true, null: false t.integer :confidence, limit: 2, index: true, null: false
t.text :project_fingerprint, index: true, null: false
end
end end
add_text_limit :security_findings, :project_fingerprint, 40 add_text_limit :security_findings, :project_fingerprint, 40
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment