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.

Patch to allow 'rake db:migrate:redo' to accept VERSION to target that migration

#1061

I find I occasionally type:


rake db:migrate:redo VERSION=20080903190605

and expect it to redo that specific migration, but redo only redoes the most recent migration (or STEPS=x migrations).

I got tired of writing:


rake db:migrate:down VERSION=20080903190605
rake db:migrate:up VERSION=20080903190605

So have patched the rake task to automatically run :down and :up if VERSION is specified for :redo, otherwise default to it's original behavior (:down, :migrate)

There are no tests as I couldn't find where rake tasks were tested. If I've missed it point it out and I'll write tests. Imperical testing suggests it works.

Reported by Philip Hallstrom · September 16th, 2008 @ 06:43 PM

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

Activity

  1. Eloy Duran
    Eloy Duran
    • Tag changed from enhancement, railties, rake to enhancement, patch, railties, rake

    +1

    September 17th, 2008 @ 09:39 AM

  2. Raul Murciano
  3. Michael Koziarski
    Michael Koziarski
    • State changed from new to committed

    c47525a58397851895b25f7c1bba06b30b0f6b5d fixes this

    September 17th, 2008 @ 10:15 AM