diff options
Diffstat (limited to 'rvh/db/schema.rb')
| -rw-r--r-- | rvh/db/schema.rb | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/rvh/db/schema.rb b/rvh/db/schema.rb index bda5cef..7e2d0b3 100644 --- a/rvh/db/schema.rb +++ b/rvh/db/schema.rb @@ -10,7 +10,10 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_03_15_204511) do +ActiveRecord::Schema.define(version: 2020_03_15_190540) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" create_table "accounts", force: :cascade do |t| t.string "name", null: false @@ -25,8 +28,8 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do create_table "beds", force: :cascade do |t| t.string "bed_number" t.string "room_number" - t.integer "care_centre_id", null: false - t.integer "patient_id" + t.bigint "care_centre_id", null: false + t.bigint "patient_id" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false t.index ["care_centre_id"], name: "index_beds_on_care_centre_id" @@ -34,7 +37,7 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do end create_table "care_centres", force: :cascade do |t| - t.integer "nurse_id", null: false + t.bigint "nurse_id", null: false t.string "name" t.string "location" t.datetime "created_at", precision: 6, null: false @@ -43,9 +46,8 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do end create_table "consumptions", force: :cascade do |t| - t.integer "patient_id", null: false - t.integer "physician_id", null: false - t.integer "item_id", null: false + t.bigint "patient_id", null: false + t.bigint "item_id", null: false t.datetime "consumed_at", null: false t.integer "quantity", null: false t.decimal "total_cost", null: false @@ -53,7 +55,6 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do t.datetime "updated_at", precision: 6, null: false t.index ["item_id"], name: "index_consumptions_on_item_id" t.index ["patient_id"], name: "index_consumptions_on_patient_id" - t.index ["physician_id"], name: "index_consumptions_on_physician_id" end create_table "items", force: :cascade do |t| @@ -72,9 +73,9 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do end create_table "patients", force: :cascade do |t| - t.integer "account_id", null: false - t.integer "physician_id", null: false - t.integer "referring_physician_id", null: false + t.bigint "account_id", null: false + t.bigint "physician_id", null: false + t.bigint "referring_physician_id", null: false t.datetime "contacted_at", null: false t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false @@ -84,8 +85,8 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do end create_table "shifts", force: :cascade do |t| - t.integer "care_centre_id", null: false - t.integer "employee_id", null: false + t.bigint "care_centre_id", null: false + t.bigint "employee_id", null: false t.datetime "started_at", null: false t.datetime "ended_at" t.datetime "created_at", precision: 6, null: false @@ -95,11 +96,11 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do end create_table "staff", force: :cascade do |t| - t.integer "account_id", null: false - t.integer "laboratory_id" + t.bigint "account_id", null: false + t.bigint "laboratory_id" t.string "type" t.datetime "hired_at" - t.text "qualifications" + t.text "qualifications", array: true t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false t.index ["account_id"], name: "index_staff_on_account_id", unique: true @@ -108,8 +109,7 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do end create_table "treatments", force: :cascade do |t| - t.integer "physician_id", null: false - t.integer "patient_id", null: false + t.bigint "patient_id", null: false t.string "name", null: false t.string "number", null: false t.datetime "occurred_at", null: false @@ -117,11 +117,10 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false t.index ["patient_id"], name: "index_treatments_on_patient_id" - t.index ["physician_id"], name: "index_treatments_on_physician_id" end create_table "visits", force: :cascade do |t| - t.integer "patient_id", null: false + t.bigint "patient_id", null: false t.datetime "scheduled_at", null: false t.text "comments" t.datetime "created_at", precision: 6, null: false @@ -130,7 +129,7 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do end create_table "volunteers", force: :cascade do |t| - t.integer "account_id", null: false + t.bigint "account_id", null: false t.text "skill", null: false t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false @@ -141,16 +140,14 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do add_foreign_key "beds", "patients" add_foreign_key "consumptions", "items" add_foreign_key "consumptions", "patients" - add_foreign_key "consumptions", "physicians" add_foreign_key "patients", "accounts" - add_foreign_key "patients", "physicians" - add_foreign_key "patients", "referring_physicians" + add_foreign_key "patients", "staff", column: "physician_id" + add_foreign_key "patients", "staff", column: "referring_physician_id" add_foreign_key "shifts", "care_centres" add_foreign_key "shifts", "staff" add_foreign_key "staff", "accounts" add_foreign_key "staff", "laboratories" add_foreign_key "treatments", "patients" - add_foreign_key "treatments", "physicians" add_foreign_key "visits", "patients" add_foreign_key "volunteers", "accounts" end |
