class CreateCommunicationBatchEmailRecipients < ActiveRecord::Migration[6.0]
  def change
    create_table :communication_batch_email_recipients do |t|
      t.references :batch_email, null: false,
        foreign_key: { to_table: :communication_batch_emails },
        index: { name: :index_batch_email_recipients_on_batch_email_id }
      t.references :associated, polymorphic: true,
        index: { name: :index_batch_email_recipients_on_associated_type_and_id }

      t.timestamps
    end
  end
end
