diff options
| author | mo khan <mo.khan@gmail.com> | 2020-03-15 15:38:46 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-03-15 15:38:46 -0600 |
| commit | 290afe2896d96fee632197386ded6dab82918d47 (patch) | |
| tree | a6f89a31a319ef6ff99064b1b88a5e173724b6db /rvh/db | |
| parent | fac25fd9d8220c3aaee2534831e3843a2dd5a706 (diff) | |
Rename employees to staff
Diffstat (limited to 'rvh/db')
| -rw-r--r-- | rvh/db/migrate/20200315180939_create_care_centres.rb | 2 | ||||
| -rw-r--r-- | rvh/db/migrate/20200315181211_create_staff.rb (renamed from rvh/db/migrate/20200315181211_create_employees.rb) | 8 | ||||
| -rw-r--r-- | rvh/db/migrate/20200315183903_create_consumptions.rb | 2 | ||||
| -rw-r--r-- | rvh/db/schema.rb | 42 |
4 files changed, 27 insertions, 27 deletions
diff --git a/rvh/db/migrate/20200315180939_create_care_centres.rb b/rvh/db/migrate/20200315180939_create_care_centres.rb index c02846c..c53a86f 100644 --- a/rvh/db/migrate/20200315180939_create_care_centres.rb +++ b/rvh/db/migrate/20200315180939_create_care_centres.rb @@ -1,7 +1,7 @@ class CreateCareCentres < ActiveRecord::Migration[6.0] def change create_table :care_centres do |t| - t.references :employee, null: false + t.references :nurse, null: false t.string :name t.string :location diff --git a/rvh/db/migrate/20200315181211_create_employees.rb b/rvh/db/migrate/20200315181211_create_staff.rb index 4dd6878..63d8bfd 100644 --- a/rvh/db/migrate/20200315181211_create_employees.rb +++ b/rvh/db/migrate/20200315181211_create_staff.rb @@ -1,14 +1,14 @@ -class CreateEmployees < ActiveRecord::Migration[6.0] +class CreateStaff < ActiveRecord::Migration[6.0] def change - create_table :employees do |t| + create_table :staff do |t| t.references :account, null: false, foreign_key: true, index: { unique: true } t.references :laboratory, null: true, foreign_key: true t.string :type t.datetime :hired_at - # physician.specialty, technician.skill, nurse.certification + # physician.specialty, technician.skill, nurse.certification, volunteer.skill t.text :qualifications, array: true t.timestamps end - add_index :employees, :type + add_index :staff, :type end end diff --git a/rvh/db/migrate/20200315183903_create_consumptions.rb b/rvh/db/migrate/20200315183903_create_consumptions.rb index f158275..cdb0997 100644 --- a/rvh/db/migrate/20200315183903_create_consumptions.rb +++ b/rvh/db/migrate/20200315183903_create_consumptions.rb @@ -2,7 +2,7 @@ class CreateConsumptions < ActiveRecord::Migration[6.0] def change create_table :consumptions do |t| t.references :patient, null: false, foreign_key: true - t.references :employee, null: false, foreign_key: true + t.references :physician, null: false, foreign_key: true t.references :item, null: false, foreign_key: true t.datetime :consumed_at, null: false t.integer :quantity, null: false diff --git a/rvh/db/schema.rb b/rvh/db/schema.rb index 319f057..bda5cef 100644 --- a/rvh/db/schema.rb +++ b/rvh/db/schema.rb @@ -34,39 +34,26 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do end create_table "care_centres", force: :cascade do |t| - t.integer "employee_id", null: false + t.integer "nurse_id", null: false t.string "name" t.string "location" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false - t.index ["employee_id"], name: "index_care_centres_on_employee_id" + t.index ["nurse_id"], name: "index_care_centres_on_nurse_id" end create_table "consumptions", force: :cascade do |t| t.integer "patient_id", null: false - t.integer "employee_id", null: false + t.integer "physician_id", null: false t.integer "item_id", null: false t.datetime "consumed_at", null: false t.integer "quantity", null: false t.decimal "total_cost", null: false t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false - t.index ["employee_id"], name: "index_consumptions_on_employee_id" t.index ["item_id"], name: "index_consumptions_on_item_id" t.index ["patient_id"], name: "index_consumptions_on_patient_id" - end - - create_table "employees", force: :cascade do |t| - t.integer "account_id", null: false - t.integer "laboratory_id" - t.string "type" - t.datetime "hired_at" - t.text "qualifications" - t.datetime "created_at", precision: 6, null: false - t.datetime "updated_at", precision: 6, null: false - t.index ["account_id"], name: "index_employees_on_account_id", unique: true - t.index ["laboratory_id"], name: "index_employees_on_laboratory_id" - t.index ["type"], name: "index_employees_on_type" + t.index ["physician_id"], name: "index_consumptions_on_physician_id" end create_table "items", force: :cascade do |t| @@ -107,6 +94,19 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do t.index ["employee_id"], name: "index_shifts_on_employee_id" end + create_table "staff", force: :cascade do |t| + t.integer "account_id", null: false + t.integer "laboratory_id" + t.string "type" + t.datetime "hired_at" + t.text "qualifications" + 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 + t.index ["laboratory_id"], name: "index_staff_on_laboratory_id" + t.index ["type"], name: "index_staff_on_type" + end + create_table "treatments", force: :cascade do |t| t.integer "physician_id", null: false t.integer "patient_id", null: false @@ -139,16 +139,16 @@ ActiveRecord::Schema.define(version: 2020_03_15_204511) do add_foreign_key "beds", "care_centres" add_foreign_key "beds", "patients" - add_foreign_key "consumptions", "employees" add_foreign_key "consumptions", "items" add_foreign_key "consumptions", "patients" - add_foreign_key "employees", "accounts" - add_foreign_key "employees", "laboratories" + add_foreign_key "consumptions", "physicians" add_foreign_key "patients", "accounts" add_foreign_key "patients", "physicians" add_foreign_key "patients", "referring_physicians" add_foreign_key "shifts", "care_centres" - add_foreign_key "shifts", "employees" + 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" |
