Class: PruneIndexes
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- PruneIndexes
- Defined in:
- db/migrate/20110812000001_prune_indexes.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
17 18 19 20 21 |
# File 'db/migrate/20110812000001_prune_indexes.rb', line 17 def self.down add_index :hosts, :comments add_index :services, :info add_index :vulns, :info end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'db/migrate/20110812000001_prune_indexes.rb', line 2 def self.up if indexes(:hosts).map{|x| x.columns }.flatten.include?("comments") remove_index :hosts, :comments end if indexes(:services).map{|x| x.columns }.flatten.include?("info") remove_index :services, :info end if indexes(:vulns).map{|x| x.columns }.flatten.include?("info") remove_index :vulns, :info end end |