class CreateCovidEmployeeTemperatures < ActiveRecord::Migration[6.0]
  def change
    create_table :covid_employee_temperatures do |t|
      t.references :employee, type: :integer, null: false,
        foreign_key: { to_table: :Users, primary_key: :UserID }

      t.datetime :recorded_at, null: false
      t.string :recorded_by, null: false
      t.decimal :temperature, null: false, scale: 1, precision: 4

      t.timestamps

      t.index [:employee_id, :recorded_at]
    end
  end
end
