This project is archived and is in readonly mode.

#5742 open
Bogdan Gusiev

Migrations rollback in production environment

Reported by Bogdan Gusiev | September 30th, 2010 @ 02:32 PM

Let's say we have batch of migrations in new production deployment.
One migration fails by some reason and deployment didn't occur.

In this case it would be great to rollback all already applied migrations in this deployment but not only the last one because the code will fall back to previous working version but database does not.

As I know Postgres support rollback of structural changes but mysql does not (not sure about others). But implementing this at least for postgres heal us from a lot of pain.

Comments and changes to this ticket

  • David Trasbo

    David Trasbo October 9th, 2010 @ 04:20 PM

    • State changed from “new” to “incomplete”
    • Importance changed from “” to “Low”

    Please provide a patch ( with a fix and/or a failing test.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:31 PM

    • State changed from “incomplete” to “open”

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:31 PM

    • State changed from “open” to “stale”
  • Bogdan Gusiev

    Bogdan Gusiev February 8th, 2011 @ 08:54 AM

    • State changed from “stale” to “open”


    Yes, I think this is important feature for rails.

    It is connected with production releases and complex migrations when the data should be changed significantly.
    All this process use to fail sometimes.

    In this case if we could rollback the database to the state before migration - we would never have problems with failed deployments.

    Will provide the failing test.

  • Bogdan Gusiev

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>