How to Rails rake multiple commands with one environment? -


is there way multiple rails 3 rake commands on 1 line, requiring environment initiated once?

i know possible:

rake db:rollback db:migrate 

but if options passed,

rake db:migrate version=0 db:migrate 

the second 'db:migrate' won't run.

i don't think possible.

the quickest solution can think of is:

rails_env=test rake db:migrate version=0 && rake db:migrate 

the reason why believe not possible because version constant, not attribute passed db:migrate option. example, of these commands work:

rake db:migrate version=0

rake version=0 db:migrate

version=0 rake db:migrate

and since can't rewrite constant in same action again, call db:migrate version=0 twice.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -