metasploit-framework/data/sql/migrate/20110812000001_prune_indexe...

24 lines
497 B
Ruby
Raw Normal View History

class PruneIndexes < ActiveRecord::Migration
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
def self.down
add_index :hosts, :comments
add_index :services, :info
add_index :vulns, :info
end
end