summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-03-15 12:07:53 -0600
committermo khan <mo.khan@gmail.com>2020-03-15 12:07:53 -0600
commit57724273c31cc034d98b47ff3dcbfc9ac4a2ce9e (patch)
treeccd7be34faf955b2b06c8c25dbfa00bda14b480e
parent8c4cdd41b41c30a08b5e9fc1d76100a034ebfd51 (diff)
Add nurses
-rw-r--r--rvh/app/models/nurse.rb3
-rw-r--r--rvh/db/migrate/20200315180659_create_nurses.rb11
-rw-r--r--rvh/db/schema.rb12
3 files changed, 25 insertions, 1 deletions
diff --git a/rvh/app/models/nurse.rb b/rvh/app/models/nurse.rb
new file mode 100644
index 0000000..483b229
--- /dev/null
+++ b/rvh/app/models/nurse.rb
@@ -0,0 +1,3 @@
+class Nurse < ApplicationRecord
+ belongs_to :account
+end
diff --git a/rvh/db/migrate/20200315180659_create_nurses.rb b/rvh/db/migrate/20200315180659_create_nurses.rb
new file mode 100644
index 0000000..fdfa932
--- /dev/null
+++ b/rvh/db/migrate/20200315180659_create_nurses.rb
@@ -0,0 +1,11 @@
+class CreateNurses < ActiveRecord::Migration[6.0]
+ def change
+ create_table :nurses do |t|
+ t.references :account, null: false, foreign_key: true
+ t.datetime :hired_at, null: false
+ t.string :certification
+
+ t.timestamps
+ end
+ end
+end
diff --git a/rvh/db/schema.rb b/rvh/db/schema.rb
index d390d0a..b66177d 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_180103) do
+ActiveRecord::Schema.define(version: 2020_03_15_180659) do
create_table "accounts", force: :cascade do |t|
t.string "name", null: false
@@ -21,6 +21,15 @@ ActiveRecord::Schema.define(version: 2020_03_15_180103) do
t.datetime "updated_at", precision: 6, null: false
end
+ create_table "nurses", force: :cascade do |t|
+ t.integer "account_id", null: false
+ t.datetime "hired_at", null: false
+ t.string "certification"
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ t.index ["account_id"], name: "index_nurses_on_account_id"
+ end
+
create_table "patients", force: :cascade do |t|
t.integer "account_id", null: false
t.datetime "contacted_at", null: false
@@ -29,5 +38,6 @@ ActiveRecord::Schema.define(version: 2020_03_15_180103) do
t.index ["account_id"], name: "index_patients_on_account_id"
end
+ add_foreign_key "nurses", "accounts"
add_foreign_key "patients", "accounts"
end