class CreateExperimentTests < ActiveRecord::Migration[7.2]
  def change
    create_table(:experiment_tests) do |t|
      t.integer :experiment_id,  null: false
      t.integer :control_job_id, null: false
      t.integer :test_job_id,    null: false
    end
    add_foreign_key :experiment_tests, :experiments
    add_foreign_key :experiment_tests, :jobs, primary_key: :run_id, column: :control_job_id
    add_foreign_key :experiment_tests, :jobs, primary_key: :run_id, column: :test_job_id
  end
end
