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.

Don't load every migration all the time

#747

Sometimes you reference Models in early migrations that have been renamed by the time you get to later versions.

This means your migrations will die with ugly errors :(

A fix is to only load the migrations that are going to actually run :)

This patch adds a MigrationStub that carries the name, version, and filename of a migration. That information is then used to load a migration when it's actually about to be run!

There are tests too :)

(For reference on it being a bug: http://groups.google.com/group/r...

Reported by nikz · August 2nd, 2008 @ 06:45 AM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. nikz
    nikz

    Added a new patch that uses MigrationProxy rather than MigrationStub, and just delegates to a load method.

    August 3rd, 2008 @ 05:16 AM

  2. nikz
  3. nikz
    nikz

    Added a patch with both commits squashed together :)

    August 5th, 2008 @ 04:53 AM

  4. Repository
    Repository
    • State changed from new to resolved

    (from [080974784582e1e289c2948227b446bc56d404a1]) Added MigrationProxy to defer loading of Migration classes until they are actually required by the migrator

    Signed-off-by: Michael Koziarski

    [#747 state:resolved]

    http://github.com/rails/rails/co...

    August 6th, 2008 @ 11:48 AM