Combining many rake tasks into one rake task

前端 未结 3 832
小蘑菇
小蘑菇 2021-02-02 10:16

Instead of running each rake task individually like this:

rake db:drop
rake db:create
rake db:migrate
rake db:load

I want to run one rake task

3条回答
  •  时光取名叫无心
    2021-02-02 10:59

    You can do it with dependencies on a task with no body.

    desc 'This rebuilds development db'
    task :rebuild_dev => ["db:drop", "db:create", "db:migrate", "db:load"]
    

提交回复
热议问题