This project is archived and is in readonly mode.
rake db:migrate skips migrations with older version numbers than current
Reported by Josh Susser | March 6th, 2010 @ 11:43 PM
Not sure if this is considered a bug, but the behavior is surprising enough that I think it's worth changing. When using timestamped migration version numbers, running db:migrate doesn't run migrations with versions less than the highest previously applied migration. Here's an example using small integers rather than big timestampy numbers:
- Start with migration versions in the db/migrate directory: 1,
2, 5, 7, 10, 12.
- run rake db:migrate # => runs all migrations
- Add migrations to directory with versions: 6, 8, 15,
16.
- run rake db:migrate # => migrations 15 & 16 are run, but 6 & 8 are skipped.
I think it is less surprising to run all the migrations, not just the ones with the version number > 12.
I can do a patch for this if people think it's the right thing to do.
Comments and changes to this ticket
-
Josh Susser March 9th, 2010 @ 07:07 AM
And now it seems like this isn't happening after all. I heard multiple reports of this and thought I reproduced it, but now I can't. Unless someone else has a reproducible case, this ticket should be closed.
-
Rohit Arondekar June 15th, 2010 @ 12:17 PM
- State changed from new to invalid
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="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>