aboutsummaryrefslogtreecommitdiffstats
path: root/db/migrate
diff options
context:
space:
mode:
authorXinhui2017-09-06 11:38:58 +0200
committerXinhui2017-09-06 11:39:07 +0200
commite2270acdfcec57a8be2ada201a668d9d610953ab (patch)
tree8f94e214a3fe9091e02dbc090d5578c766aae23e /db/migrate
parent55f142f0a2ef77b88229585225edd561fcf53d92 (diff)
downloadchouette-core-e2270acdfcec57a8be2ada201a668d9d610953ab.tar.bz2
Model ComplianceCheckResult
Refs #4390
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20131029115820_create_compliance_check_results.rb23
-rw-r--r--db/migrate/20170906092619_create_compliance_check_results.rb13
2 files changed, 13 insertions, 23 deletions
diff --git a/db/migrate/20131029115820_create_compliance_check_results.rb b/db/migrate/20131029115820_create_compliance_check_results.rb
deleted file mode 100644
index 7f5c8e436..000000000
--- a/db/migrate/20131029115820_create_compliance_check_results.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-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_compliance_check_results.rb
new file mode 100644
index 000000000..e917d384e
--- /dev/null
+++ b/db/migrate/20170906092619_create_compliance_check_results.rb
@@ -0,0 +1,13 @@
+class CreateComplianceCheckResults < ActiveRecord::Migration
+ def change
+ 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
+ t.string :message_key
+ t.hstore :message_attributes
+ t.hstore :resource_attributes
+
+ t.timestamps null: false
+ end
+ end
+end