class CreateLibraryContributors < ActiveRecord::Migration[6.0]
  def change
    create_table :library_contributors do |t|
      t.references :school, type: :integer, null: false,
        foreign_key: { to_table: :Schools, primary_key: :SchoolID }

      t.string :name, null: false, limit: 128

      t.timestamps

      t.index [:school_id, :name], unique: true
    end
  end
end
