Sha256: 9220920150f4f8c2d10c4430805c709f24da872dc3587a190e57ab9860123cb5

Contents?: true

Size: 898 Bytes

Versions: 4

Compression:

Stored size: 898 Bytes

Contents

class AddMissingIndices < ActiveRecord::Migration[4.2]
  def change
    # We'll explicitly specify its name, as the auto-generated name is too long and exceeds 63
    # characters limitation.
    add_index :mailboxer_conversation_opt_outs, [:unsubscriber_id, :unsubscriber_type],
      name: 'index_mailboxer_conversation_opt_outs_on_unsubscriber_id_type'
    add_index :mailboxer_conversation_opt_outs, :conversation_id

    add_index :mailboxer_notifications, :type
    add_index :mailboxer_notifications, [:sender_id, :sender_type]

    # We'll explicitly specify its name, as the auto-generated name is too long and exceeds 63
    # characters limitation.
    add_index :mailboxer_notifications, [:notified_object_id, :notified_object_type],
      name: 'index_mailboxer_notifications_on_notified_object_id_and_type'

    add_index :mailboxer_receipts, [:receiver_id, :receiver_type]
  end
end

Version data entries

4 entries across 2 versions & 1 rubygems

Version Path
mailboxer-0.15.1 db/migrate/20131206080417_add_missing_indices.rb
mailboxer-0.15.1 spec/dummy/db/migrate/20151103202534_add_missing_indices.mailboxer_engine.rb
mailboxer-0.15.0 db/migrate/20131206080417_add_missing_indices.rb
mailboxer-0.15.0 spec/dummy/db/migrate/20151103202534_add_missing_indices.mailboxer_engine.rb