aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Peignier2017-09-13 14:08:11 +0200
committerAlban Peignier2017-09-13 14:08:11 +0200
commit12b2c712924048783609ae1c8e4b654b81b4d519 (patch)
tree2b1b37ea14544b5e836f0cfbc54278f83284200d
parent739d8f72dfccc858ce52db2d4a2222cce87418a4 (diff)
downloadchouette-core-12b2c712924048783609ae1c8e4b654b81b4d519.tar.bz2
Restore /20131029115820_create_compliance_check_results. Refs #4469
-rw-r--r--db/migrate/20131029115820_create_compliance_check_results.rb23
-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