blob: 7f5c8e436f73797ed2e3fbb1d7066d7d3dcc90e0 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
 |