Skip to content

Rails Run or Redo Specific Migration

If you are in a funny situation where you have to run a specific migration file on your Ruby on Rails project then this command will help you:

rails db:migrate:up VERSION=20100905201547

This command runs only that specific file regardless of order of other migration files 🙂

You can find the version name on the migration file name.

And if you want to do the opposite action to redo a migration use this command:

rails db:migrate:down VERSION=20100905201547

Leave a Reply

Your email address will not be published. Required fields are marked *