class CreateCovidScreenings < ActiveRecord::Migration[6.0]
  def change
    create_table :covid_screenings do |t|
      t.references :student, type: :integer, null: false, index: false,
        foreign_key: { to_table: :Students, primary_key: :StudentID }

      t.date :date, null: false
      t.timestamps

      t.index [:student_id, :date], unique: true
    end
  end
end
