class CreateEdfiStudentIndicators < ActiveRecord::Migration[6.0]
  def change
    create_table :EdFi_StudentIndicators, primary_key: :StudentIndicatorID do |t|
      t.integer :SchoolID, null: false
      t.integer :StudentID, null: false
      t.integer :SchoolYearStudentID, null: false

      t.index [:SchoolID, :StudentID]
    end

    add_foreign_key :EdFi_StudentIndicators, :Schools, column: :SchoolID,
      primary_key: :SchoolID

    add_foreign_key :EdFi_StudentIndicators, :Students, column: :StudentID,
      primary_key: :StudentID

    add_foreign_key :EdFi_StudentIndicators, :SchoolYearStudents,
      column: :SchoolYearStudentID, primary_key: :SchoolYearStudentID
  end
end
