To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / db / migrate / 20091017213027_add_missing_indexes_to_comments.rb @ 441:cbce1fd3b1b7
History | View | Annotate | Download (312 Bytes)
| 1 |
class AddMissingIndexesToComments < ActiveRecord::Migration |
|---|---|
| 2 |
def self.up |
| 3 |
add_index :comments, [:commented_id, :commented_type] |
| 4 |
add_index :comments, :author_id |
| 5 |
end
|
| 6 |
|
| 7 |
def self.down |
| 8 |
remove_index :comments, :column => [:commented_id, :commented_type] |
| 9 |
remove_index :comments, :author_id |
| 10 |
end
|
| 11 |
end
|