diff options
| -rw-r--r-- | db/migrate/20131029115820_create_compliance_check_results.rb | 23 | ||||
| -rw-r--r-- | db/migrate/20170906092619_create_new_compliance_check_results.rb (renamed from db/migrate/20170906092619_create_compliance_check_results.rb) | 3 |
2 files changed, 25 insertions, 1 deletions
diff --git a/db/migrate/20131029115820_create_compliance_check_results.rb b/db/migrate/20131029115820_create_compliance_check_results.rb new file mode 100644 index 000000000..7f5c8e436 --- /dev/null +++ b/db/migrate/20131029115820_create_compliance_check_results.rb @@ -0,0 +1,23 @@ +class CreateComplianceCheckResults < ActiveRecord::Migration + def up + unless table_exists? :compliance_check_results + create_table :compliance_check_results do |t| + t.belongs_to :compliance_check_task , :null => :no ,:limit => 8 + t.string :rule_code # rule code value + t.string :severity # warning, error, improvement + t.string :status # NA, OK, NOK + t.integer :violation_count # number of violation occurences + t.text :detail # detail of violation location + t.timestamps + end + add_foreign_key :compliance_check_results, :compliance_check_tasks, :on_delete => :cascade + end + end + + def down + if table_exists? :compliance_check_results + execute "drop table compliance_check_results" + # drop_table :compliance_check_results + end + end +end diff --git a/db/migrate/20170906092619_create_compliance_check_results.rb b/db/migrate/20170906092619_create_new_compliance_check_results.rb index e917d384e..a22800a8f 100644 --- a/db/migrate/20170906092619_create_compliance_check_results.rb +++ b/db/migrate/20170906092619_create_new_compliance_check_results.rb @@ -1,5 +1,6 @@ -class CreateComplianceCheckResults < ActiveRecord::Migration +class CreateNewComplianceCheckResults < ActiveRecord::Migration def change + drop_table :compliance_check_results if table_exists? :compliance_check_results create_table :compliance_check_results do |t| t.references :compliance_check, index: true, foreign_key: true t.references :compliance_check_resource, index: true, foreign_key: true |
