aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorXinhui2017-09-06 10:59:44 +0200
committerXinhui2017-09-06 10:59:44 +0200
commit64e68de279967fc352f96e414ddb04bd32aa8a74 (patch)
treef3e2240cddf750196dcb55f8bf0f2ca599130f7b /db
parent26affe0da7bb7987e54c862e40acd4db8641d162 (diff)
downloadchouette-core-64e68de279967fc352f96e414ddb04bd32aa8a74.tar.bz2
Model ComplianceCheck
Refs #4388
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170906084628_create_compliance_checks.rb16
-rw-r--r--db/schema.rb20
2 files changed, 35 insertions, 1 deletions
diff --git a/db/migrate/20170906084628_create_compliance_checks.rb b/db/migrate/20170906084628_create_compliance_checks.rb
new file mode 100644
index 000000000..1d6bdaaf2
--- /dev/null
+++ b/db/migrate/20170906084628_create_compliance_checks.rb
@@ -0,0 +1,16 @@
+class CreateComplianceChecks < ActiveRecord::Migration
+ def change
+ create_table :compliance_checks do |t|
+ t.references :compliance_check_set, index: true, foreign_key: true
+ t.references :compliance_check_block, index: true, foreign_key: true
+ t.string :type
+ t.json :control_attributes
+ t.string :name
+ t.string :code
+ t.integer :criticity
+ t.text :comment
+
+ t.timestamps null: false
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 29887979f..1cc3692cf 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20170905135646) do
+ActiveRecord::Schema.define(version: 20170906084628) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -172,6 +172,22 @@ ActiveRecord::Schema.define(version: 20170905135646) do
add_index "compliance_check_sets", ["referential_id"], name: "index_compliance_check_sets_on_referential_id", using: :btree
add_index "compliance_check_sets", ["workbench_id"], name: "index_compliance_check_sets_on_workbench_id", using: :btree
+ create_table "compliance_checks", id: :bigserial, force: :cascade do |t|
+ t.integer "compliance_check_set_id"
+ t.integer "compliance_check_block_id"
+ t.string "type"
+ t.json "control_attributes"
+ t.string "name"
+ t.string "code"
+ t.integer "criticity"
+ t.text "comment"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ add_index "compliance_checks", ["compliance_check_block_id"], name: "index_compliance_checks_on_compliance_check_block_id", using: :btree
+ add_index "compliance_checks", ["compliance_check_set_id"], name: "index_compliance_checks_on_compliance_check_set_id", using: :btree
+
create_table "compliance_control_blocks", id: :bigserial, force: :cascade do |t|
t.string "name"
t.hstore "condition_attributes"
@@ -924,6 +940,8 @@ ActiveRecord::Schema.define(version: 20170905135646) do
add_foreign_key "compliance_check_sets", "compliance_control_sets"
add_foreign_key "compliance_check_sets", "referentials"
add_foreign_key "compliance_check_sets", "workbenches"
+ add_foreign_key "compliance_checks", "compliance_check_blocks"
+ add_foreign_key "compliance_checks", "compliance_check_sets"
add_foreign_key "compliance_control_blocks", "compliance_control_sets"
add_foreign_key "compliance_control_sets", "organisations"
add_foreign_key "compliance_controls", "compliance_control_blocks"