Rails migration redo
A very good practice, when writing a rails migration, is to be sure that the down methods works as expected. Once the migration is ready you should make it run and, if anything is fine, you should rollback it and run it again. In this way you are sure that both the up and down migration works as you planned.
To make it faster you can use the following command
This will run a rollback of the lates migration and will run it again.
You can even say how many steps you want to rollback and the re apply using the steps attributes as you do in a normal roll back command:
rake db:migrate:redo step=2