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.

db:migrate:down should default to the current migration

#1197

$ rake -T | grep down
rake db:migrate:down    # Runs the "down" for a given migration VERSION.
$ rake db:migrate:down
rake aborted!
VERSION is required

Most of the time I use this, it's while I'm developing a migration and I want to run the down for the one I'm working on. I think that if you don't set a VERSION that it should just figure out the current version and use that.

Similarly, db:migrate:up should default to the one greater than the one you're working on, though that could be trickier because it would have to deduce this from the file system.

Reported by David Chelimsky · October 10th, 2008 @ 06:18 PM

State: wontfix
Milestone: none
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Pratik
    Pratik
    • Milestone cleared.
    • Assigned user set to Pratik

    January 11th, 2009 @ 02:55 PM

  2. michael (at mdaines)
    michael (at mdaines)

    What about db:migrate:rollback?

    January 13th, 2009 @ 03:49 PM

  3. Pratik
    Pratik
    • State changed from new to wontfix

    What michael said. db:migrate:rollback - rollbacks one version. It takes STEP env var argument too, in case you want to rollback more than 1 versions. And to migrate up, could just use the good ol' db:migrate :)

    There's also db:migrate:redo which rollbacks a version and applies it again.

    Thanks.

    January 18th, 2009 @ 04:11 AM