To prepare database for my Ruby on Rails 3 application I need to run the following steps in the Terminal:
rake db:create
rake db:migrate
rake db:seed
Is it possible to do all those steps in one? Maybe it is possible running a ‘rake’ command that will “fire” another ‘rake’ command… but how?!
You can define your own rake tasks which call other tasks as prerequisites:
Normally the body of the task would contain Ruby code to do something, but in this case we are just invoking the three prerequisite tasks in turn (
db:create,db:migrate,db:seed).