Thursday, April 21, 2011

Shortcut for rake db:migrate:down for ruby-on-rails

Hi,

I want to know if there is a short way to do the migrations down equivalent to rake db:migrate (for the migrations up). Instead of doing : rake db:migrate:up VERSION=1, rake db:migrate:up VERSION=2, ... we can do : rake db:migrate! But for : rake db:migrate:down VERSION=10, rake db:migrate:down VERSION=..., rake db:migrate:down VERSION=1, is there a shortcut?

Tank you for your help!

From stackoverflow
  • I don't think there is a premade task for doing what you want. You can see all of the available rake tasks using rake -T.

  • rake db:migrate VERSION=0 will remove all migrations, if that's what you're trying to do.

    Michaƫl : Thank you, it was exactly what I was looking for!

0 comments:

Post a Comment