summaryrefslogtreecommitdiffstats
path: root/db/migrate/20091017213027_add_missing_indexes_to_comments.rb
blob: 4bb8c001049a439b0799b66e6f97b34d60f89ba6 (plain)
1
2
3
4
5
6
7
8
9
10
11
class AddMissingIndexesToComments < ActiveRecord::Migration[4.2]
  def self.up
    add_index :comments, [:commented_id, :commented_type]
    add_index :comments, :author_id
  end

  def self.down
    remove_index :comments, :column => [:commented_id, :commented_type]
    remove_index :comments, :author_id
  end
end