summaryrefslogtreecommitdiff
path: root/rvh/db/migrate/20200315180102_create_staff.rb
blob: 63d8bfd793378c2cdaf514b185519606cb2b4147 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class CreateStaff < ActiveRecord::Migration[6.0]
  def change
    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, volunteer.skill
      t.text :qualifications, array: true
      t.timestamps
    end
    add_index :staff, :type
  end
end