summaryrefslogtreecommitdiffstats
path: root/db/migrate/20091017213027_add_missing_indexes_to_comments.rb
blob: 607ed49fa86ac25fc8ef5430ec2a2b48445e3fdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: false

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