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.

This project is archived and is in readonly mode.

rake db:migrate skips migrations with older version numbers than current

#4120

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:

  1. Start with migration versions in the db/migrate directory: 1, 2, 5, 7, 10, 12.
  2. run rake db:migrate # => runs all migrations
  3. Add migrations to directory with versions: 6, 8, 15, 16.
  4. 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.

Reported by Josh Susser · March 6th, 2010 @ 11:43 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Josh Susser
    Josh Susser

    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.

    March 9th, 2010 @ 07:07 AM

  2. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to invalid

    June 15th, 2010 @ 12:17 PM