简体   繁体   English

Rake db:migrate:down的快捷方式

[英]Shortcut for rake db:migrate:down for ruby-on-rails

I want to know if there is a short way to do the migrations down equivalent to rake db:migrate (for the migrations up). 我想知道是否有一种简短的方法来进行向下迁移,这等同于rake db:migrate(用于向上迁移)。 Instead of doing : rake db:migrate:up VERSION=1, rake db:migrate:up VERSION=2, ... we can do : rake db:migrate! 代替做:rake db:migrate:up VERSION = 1,rake db:migrate:up VERSION = 2,...我们可以做: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? 但是对于:rake db:migrate:down VERSION = 10,rake db:migrate:down VERSION = ...,rake db:migrate:down VERSION = 1,是否有快捷方式?

Tank you for your help! 吸引您的帮助!

rake db:migrate VERSION=0将删除所有迁移,如果您要这样做的话。

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 -T查看所有可用的rake任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM