diff options
| author | mo khan <mo.khan@gmail.com> | 2020-03-15 12:28:59 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-03-15 12:28:59 -0600 |
| commit | 7c69e5022d3d11b8d727498d21ac804a0797913c (patch) | |
| tree | 65d161b60c9ac7aefd7759e4d7ce401cbd60178e /rvh/db | |
| parent | 6672665002658a8f7f16ab0ee4540bb04cf929b7 (diff) | |
Create visits
Diffstat (limited to 'rvh/db')
| -rw-r--r-- | rvh/db/migrate/20200315182810_create_visits.rb | 11 | ||||
| -rw-r--r-- | rvh/db/schema.rb | 14 |
2 files changed, 23 insertions, 2 deletions
diff --git a/rvh/db/migrate/20200315182810_create_visits.rb b/rvh/db/migrate/20200315182810_create_visits.rb new file mode 100644 index 0000000..0c70f28 --- /dev/null +++ b/rvh/db/migrate/20200315182810_create_visits.rb @@ -0,0 +1,11 @@ +class CreateVisits < ActiveRecord::Migration[6.0] + def change + create_table :visits do |t| + t.references :patient, null: false, foreign_key: true + t.datetime :scheduled_at, null: false + t.text :comments + + t.timestamps + end + end +end diff --git a/rvh/db/schema.rb b/rvh/db/schema.rb index 8b5cdf9..450c169 100644 --- a/rvh/db/schema.rb +++ b/rvh/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_03_15_182410) do +ActiveRecord::Schema.define(version: 2020_03_15_182810) do create_table "accounts", force: :cascade do |t| t.string "name", null: false @@ -60,7 +60,7 @@ ActiveRecord::Schema.define(version: 2020_03_15_182410) do create_table "shifts", force: :cascade do |t| t.integer "care_centre_id", null: false t.integer "employee_id", null: false - t.datetime "started_at" + t.datetime "started_at", null: false t.datetime "ended_at" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false @@ -68,9 +68,19 @@ ActiveRecord::Schema.define(version: 2020_03_15_182410) do t.index ["employee_id"], name: "index_shifts_on_employee_id" end + create_table "visits", force: :cascade do |t| + t.integer "patient_id", null: false + t.datetime "scheduled_at", null: false + t.text "comments" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["patient_id"], name: "index_visits_on_patient_id" + end + add_foreign_key "beds", "care_centres" add_foreign_key "beds", "patients" add_foreign_key "patients", "accounts" add_foreign_key "shifts", "care_centres" add_foreign_key "shifts", "employees" + add_foreign_key "visits", "patients" end |
