rails run specific migration

Ruby on-RailsMigration

Ruby on-Rails Problem Overview


I've deleted a table in the database, call it X. db:migrate no longer works. I have a migration file called CreateX. Is there a way to run just that specific migration?

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

rake db:migrate:redo VERSION=my_version

Or you can go up or down from a specific version:

db:migrate:up VERSION=my_version
db:migrate:down VERSION=my_version

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDanielView Question on Stackoverflow
Solution 1 - Ruby on-RailsJP SilvashyView Answer on Stackoverflow