CakePHP Migrations
I’ve been using Capistrano to mange my deployments for a while now. It took a little massaging of the deploy.rb file to make it live happily alongside CakePHP, but those were just one-time changes and all has been running smoothly ever since. Well, all but one thing — one big, third-form normalized thing: the Database.
I run my development process split between two machines: my local machine and a test server. The test server runs the exact same Apache configuration as the deployment server and my local workstation runs LightTTPD straight out of my SVK checkout directory. This lets me work nice a fast on the local machine and then with two commands push the changes out to the testbed.
Well, almost. Because after the wonderful two command magic, I go into CocoaMySQL, export the DB, log into PHPMyAdmin on the testbed and import the revised schema. (After a quick sidetrip into TextMate to massage the SQL dump into a format the version of MySQL on the server will like.) Capistrano is perfectly capable of pushing schema changes out to the server, but it’s biased towards using Rails’ Migrations to do it. And Cake doesn’t have a parallel.
Needless to say, I’ve been meaning to bash out a little shell script to band-aid this situation. Just something to dump the schema locally, massage it, and commit it to svk. Along with a sister script to pull the schema out of svn and run it through MySQL on the server. Not an elegant solution by any means, but it’d save me some time. However, I have a number of things I’ve been meaning to do…
Luckily, the situation has changed. A port of Rails Migrations to CakePHP has entered the picture. It’s still in the embryonic stages, but even now it’s miles ahead of my current status quo. Now I just have to find a minute to get Cake Migrations integrated with Capistrano.

Hey Scott, just so you know; I am just finishing off the latest version of Cake Migrations. At present you can only create and drop tables, but the new version will allow you to add/drop columns, insert/remove test data and (hopefully) run raw SQL statements.
Thanks for the mention and don’t forget to check out my Blog (http://joelmoss.info) for updates.
Could you share how you make Capistrano work with CakePHP? I will be grateful 4 all my life.