Sha256: 1607789f5f53842bbd5505518edb11bac58dff3b8d4fc7cece84c7ae22f36e98

Contents?: true

Size: 519 Bytes

Versions: 3

Compression:

Stored size: 519 Bytes

Contents

# typed: ignore
class AddIndexesToMessages < ActiveRecord::Migration[4.2]
  def self.up
    add_index :<%= table_name %>, [:sent_messageable_id, :sent_messageable_type], :name => "acts_as_messageable_sent"
    add_index :<%= table_name %>, [:received_messageable_id, :received_messageable_type], :name => "acts_as_messageable_received"
  end

  def self.down
    remove_index :<%= table_name %>, :name => "acts_as_messageable_sent"
    remove_index :<%= table_name %>, :name => "acts_as_messageable_received"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
acts-as-messageable-1.0.2 lib/generators/acts_as_messageable/migration/templates/migration_indexes.rb
acts-as-messageable-1.0.1 lib/generators/acts_as_messageable/migration/templates/migration_indexes.rb
acts-as-messageable-1.0.0 lib/generators/acts_as_messageable/migration/templates/migration_indexes.rb