class CreateExerciseUserQuestions < ActiveRecord::Migration[5.2]
  def change
    create_table :exercise_user_questions do |t|
      t.integer :exercise_id, index: true
      t.integer :exercise_user_id, index: true
      t.integer :user_id, index: true
      t.integer :exercise_question_id, index: true

      t.timestamps
    end
    add_index :exercise_user_questions, [:exercise_user_id, :exercise_question_id], name: "index_on_user_question", unique: true
  end
end
