I usually:
- Perform a
rake db:migrate VERSION=XXXon all environments, to the version before the one I want to delete. - Delete the migration file manually.
- If there are pending migrations (i.e., the migration I removed was not the last one), I just perform a new
rake db:migrateagain.
If your application is already on production or staging, it’s safer to just write another migration that destroys your table or columns.
Another great reference for migrations is: http://guides.rubyonrails.org/migrations.html