diff options
| author | Xinhui | 2017-09-05 15:20:12 +0200 |
|---|---|---|
| committer | Xinhui | 2017-09-05 15:20:12 +0200 |
| commit | 92703917b31cbaf7f4e5e1bafd009eee2d26c6a1 (patch) | |
| tree | d4b42934b90ab6d6ad3467082d405d79a2319e99 /db | |
| parent | 37947deb6082d12ecfbce3bd7cbf18bc98762d41 (diff) | |
| download | chouette-core-92703917b31cbaf7f4e5e1bafd009eee2d26c6a1.tar.bz2 | |
Model ComplianceCheckSet
Refs #4386
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20170905130413_create_compliance_check_sets.rb | 14 | ||||
| -rw-r--r-- | db/schema.rb | 22 |
2 files changed, 35 insertions, 1 deletions
diff --git a/db/migrate/20170905130413_create_compliance_check_sets.rb b/db/migrate/20170905130413_create_compliance_check_sets.rb new file mode 100644 index 000000000..21055a3f2 --- /dev/null +++ b/db/migrate/20170905130413_create_compliance_check_sets.rb @@ -0,0 +1,14 @@ +class CreateComplianceCheckSets < ActiveRecord::Migration + def change + create_table :compliance_check_sets do |t| + t.references :referential, index: true, foreign_key: true + t.references :compliance_control_set, index: true, foreign_key: true + t.references :workbench, index: true, foreign_key: true + t.string :creator + t.string :status + t.references :parent, polymorphic: true, index: true + + t.timestamps null: false + end + end +end diff --git a/db/schema.rb b/db/schema.rb index df887f277..dad05b449 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: 20170905123421) do +ActiveRecord::Schema.define(version: 20170905130413) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -145,6 +145,23 @@ ActiveRecord::Schema.define(version: 20170905123421) do add_index "companies", ["objectid"], name: "companies_objectid_key", unique: true, using: :btree add_index "companies", ["registration_number"], name: "companies_registration_number_key", using: :btree + create_table "compliance_check_sets", id: :bigserial, force: :cascade do |t| + t.integer "referential_id" + t.integer "compliance_control_set_id" + t.integer "workbench_id" + t.string "creator" + t.string "status" + t.integer "parent_id" + t.string "parent_type" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "compliance_check_sets", ["compliance_control_set_id"], name: "index_compliance_check_sets_on_compliance_control_set_id", using: :btree + add_index "compliance_check_sets", ["parent_type", "parent_id"], name: "index_compliance_check_sets_on_parent_type_and_parent_id", using: :btree + 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_control_blocks", id: :bigserial, force: :cascade do |t| t.string "name" t.hstore "condition_attributes" @@ -893,6 +910,9 @@ ActiveRecord::Schema.define(version: 20170905123421) do add_foreign_key "access_links", "access_points", name: "aclk_acpt_fkey" add_foreign_key "api_keys", "organisations" + 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_control_blocks", "compliance_control_sets" add_foreign_key "compliance_control_sets", "organisations" add_foreign_key "compliance_controls", "compliance_control_blocks" |
