Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

BUG: Rollback is not executed in the same order it was applied

#63

Given the following migrations:

  • 20100101101011_Do_something
  • 20100101101012_Do_something_Else
  • 20100101101013_Do_something_another
  • 20100101101014_Do_something_yet_another
  • 20100101101015_Do_something_once_more

Say we apply the first two when we go live in release 1. Now our prod database has:

  • 20100101101011_Do_something
  • 20100101101012_Do_something_Else

Applied in this order. Now in release 2 we apply the last two:

  • 20100101101014_Do_something_yet_another
  • 20100101101015_Do_something_once_more

The middle one (20100101101013_Do_something_another) is in a branch not ready for production.

Then after some time we apply the last one. Now our database has the following versions applied (in this order):

  • 20100101101011_Do_something
  • 20100101101012_Do_something_Else
  • 20100101101014_Do_something_yet_another
  • 20100101101015_Do_something_once_more
  • 20100101101013_Do_something_another

This is fine, since it was the actual order we applied them. The issue is if we try to go down to 20100101101015_Do_something_once_more. We'll get an error because db-migrate tries to order the migrations based in timestamp (which clearly does not work in this context).

There should be an abstract id that gets auto-incremented for every migration. The rollback should be executed based in this id.

Reported by Bernardo Heynemann · July 14th, 2010 @ 06:10 PM

State: resolved
Milestone: none
Assigned to: Bernardo Heynemann Bernardo Heynemann

Activity

  1. Wandenberg Peixoto
    Wandenberg Peixoto
    • State changed from new to resolved
    • Milestone cleared.
    • Milestone order changed from 11 to 0

    April 1st, 2012 @ 10:55 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.