class CreateFinancialAidWaivers < ActiveRecord::Migration[6.1]
  def change
    create_table :financial_aid_waivers do |t|
      t.references :school_year, type: :integer, null: false,
        foreign_key: { to_table: :SchoolYears, primary_key: :SchoolYearID }
      t.references :family, type: :integer, null: false, 
        foreign_key: { to_table: :Families, primary_key: :FamilyID }

      t.timestamps
      
      t.index [:school_year_id, :family_id], unique: true
    end
  end
end
