ruby on rails - How to remove the cancelled migration from the db folder -
i want remove migration application.
i have migration file 20141105030942_removedate_fromexpense.rb
the class file migrations
class removedatefromexpense < activerecord::migration def change remove_column :expenses, :date, :date end end
when give command:
rake db:migrate:down version=20141105030942
i following error:
== 20141105030942 removedatefromexpense: reverting ============================ -- add_column(:expenses, :date, :date) rake aborted! standarderror: error has occurred, migration canceled: sqlite3::sqlexception: duplicate column name: date: alter table "expenses" add "date" date/home/sumyvps/.rvm/gems/ruby-1.9.3-p545@railstutorial_rails_4_0/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:91:in `initialize' db:migrate:status migration file below 20141105030942 removedate fromexpense
has idea why happening?
you not need specify column type in migration file. name of table , column enough remove column table.
edit migration file to:
class removedatefromexpense < activerecord::migration def change remove_column :expenses, :date end end
and run:
rake db:migrate
this should work.
Comments
Post a Comment