Ruby on Rails Redo migrations


Example

You can rollback and then migrate again using the redo command. This is basically a shortcut that combines rollback and migrate tasks.

Run command:

5.0
rake db:migrate:redo
5.0
rails db:migrate:redo

You can use the STEP parameter to go back more than one version.

For example, to go back 3 migrations:

5.0
rake db:migrate:redo STEP=3
5.0
rails db:migrate:redo STEP=3