Chris@909: class AddMissingIndexesToWatchers < ActiveRecord::Migration Chris@909: def self.up Chris@909: add_index :watchers, :user_id Chris@909: add_index :watchers, [:watchable_id, :watchable_type] Chris@909: end Chris@909: Chris@909: def self.down Chris@909: remove_index :watchers, :user_id Chris@909: remove_index :watchers, :column => [:watchable_id, :watchable_type] Chris@909: end Chris@909: end