I've also tried doing:
But this, obviously, doesn't work since %x[rake migrate]
spanws a new process outside of the scope of the
To invoke a Rake task in a migration, you can do :
I have tried with : Rake::Task['stats'].invoke and it works.
However, it can be dangerous, what will happen with a
Rake::Task['db:migrate'] ? infinite loop ? it could be a mess...
I think a rake db task would work, but you have to be careful.