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
-
Wandenberg Peixoto April 1st, 2012 @ 10:55 PM
- State changed from new to resolved
- Milestone cleared.
- Milestone order changed from 11 to 0
Fixed on version 1.3.9
https://github.com/guilhermechapiewski/simple-db-migrate/commit/2d6...
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.
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/