This project is archived and is in readonly mode.

#1061 ✓committed
Philip Hallstrom

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

Reported by Philip Hallstrom | September 16th, 2008 @ 06:43 PM | in 2.x

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.

Comments and changes to this ticket

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>

Attachments

Pages