summaryrefslogtreecommitdiffstats
path: root/db/migrate/20091017213228_add_missing_indexes_to_watchers.rb
blob: 18e948ec680b80919814eb562a41245b4ed78738 (plain)
1
2
3
4
5
6
7
8
9
10
11
class AddMissingIndexesToWatchers < ActiveRecord::Migration[4.2]
  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