#63 ✓resolved
Bernardo Heynemann

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

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

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.

Comments and changes to this ticket

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.

New-ticket Create new ticket

Create your profile

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

simple-db-migrate is a database migration tool inpired on Rails migrations. For more info check the project website: http://guilhermechapiewski.github.com/simple-db-migrate/

People watching this ticket

Pages