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

      t.integer :event, null: false
      t.string :domain, null: false, limit: 128
      t.integer :verified, null: false, default: false

      t.timestamps

      t.index [:school_id, :event]
    end
  end
end
