class CreateCovidEmployeeAnswers < ActiveRecord::Migration[6.0]
  def change
    create_table :covid_employee_answers do |t|
      t.references :screening, null: false, index: false,
        foreign_key: { to_table: :covid_employee_screenings }
      t.references :question, null: false, foreign_key: { to_table: :covid_form_fields }

      t.text :value

      t.timestamps

      t.index [:screening_id, :question_id], unique: true
    end
  end
end
