Hey guys, I’ve been struggling recently with how to make sure my migrations get run at the right time as I push to the remote webserver (I’m using Heroku). I finally came up with the solution, which I’ll describe briefly in case it helps anyone else out.
You first have to set up a Procfile the defines the boot script as a copy of the standard boot script (something like web-boot.sh). Then you need to add to that boot script
bin/php www/protected/yiic.php migrate --interactive=0
. Now, every time you push code to Heroku, it will execute your migrations before your new code goes live. You can read the full post here: aaronfrancis.com/blog/2013/5/2/automate-yii-migrations-in-heroku and feel free to ask any questions, I’ll do what I can to help.