Forcing a Rails database migration

Today I accidentally ran migrations on a production environment that shouldn't run. Luckily, the table wasn't critical, but it did cause a feature of...
Michiel Sikkes
April 4, 2016

Today I accidentally ran migrations on a production environment that shouldn't run. Luckily, the table wasn't critical, but it did cause a feature of an app to break.

There is not a straight forward way to "force" a previous migration that already ran via a simple Rake command or something.

Eventually, I found a solution inspired by this post on StackOverflow: http://stackoverflow.com/questions/753919/run-a-single-migration-file.

Here's what I did to bring back the table by re-running the previous migration.

Questions or comments?

If you have any questions or comments, please let me know! You can reach me on Twitter via @michiels or send me an email at mailto:michiel@firmhouse.com.

Receive updates
Receive our latest product updates and blog posts in your inbox. No spam, just the latest about the Firmhouse platform.
Read about our privacy policy.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.