Ruby on Rails Run specific migration


Example

To run a specific migration up or down, use db:migrate:up or db:migrate:down.

Up a specific migration:

5.0
rake db:migrate:up VERSION=20090408054555
5.0
rails db:migrate:up VERSION=20090408054555 

Down a specific migration:

5.0
rake db:migrate:down VERSION=20090408054555
5.0
rails db:migrate:down VERSION=20090408054555

The version number in the above commands is the numeric prefix in the migration’s filename. For example, to migrate to the migration 20160515085959_add_name_to_users.rb, you would use 20160515085959 as the version number.