ruby on rails - How to reverse an extend migration -


i ran migration while installing fuzzily gem:

class addtrigramsmodel < activerecord::migration   extend fuzzily::migration end 

from looking @ schema.rb file, looks effect of migration was:

  create_table "trigrams", :force => true |t|     t.string  "trigram",     :limit => 3     t.integer "score",       :limit => 2     t.integer "owner_id"     t.string  "owner_type"     t.string  "fuzzy_field"   end    add_index "trigrams", ["owner_id", "owner_type", "fuzzy_field", "trigram", "score"], :name => "index_for_match"   add_index "trigrams", ["owner_id", "owner_type"], :name => "index_by_owner" 

not sure if easiest way drop table trigrams, or if there more appropriate method? assuming indexes deleted on dropping table?

just run rake db:rollback. fuzzily has support rollbacks. although dropping trigrams table :)

# lib/fuzzily/migration.rb:33 def down   drop_table trigrams_table_name end 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -