summaryrefslogtreecommitdiffstats
path: root/db/migrate/20091017213228_add_missing_indexes_to_watchers.rb
blob: 618e1cd94a5d721257bf9a57d25f9d3c011e341c (plain)
1
2
3
4
5
6
7
8
9
10
11
class AddMissingIndexesToWatchers < ActiveRecord::Migration
  def self.up
    add_index :watchers, :user_id
    add_index :watchers, [:watchable_id, :watchable_type]
  end

  def self.down
    remove_index :watchers, :user_id
    remove_index :watchers, :column => [:watchable_id, :watchable_type]
  end
end