CakePHP Migrations 2.1, migration guide
Thursday, 22 March 2012
I’m in the process of moving a CakePHP 1.3 app into the 2.1 world.
One thing that changed that I could not find documented anywhere is that the new migration plugin doesn’t use the map.php file anymore but relies on a naming convention.
VersionNumber-name.php
Where_VersionNumber_ is the version number of the migration. For example on my app:
001_initial.php
002_chapter_word_count.php
003_story_disclaimer_field.php
004_follows.php
005_reviews.php
006_chapter_review_count.php
You can pad with as many zeros as you feel you’ll need. Are 999 migrations not enough? Also each class name needs to be changed to the camelized version of the file name without the version number, so 001_initial.php should start like this:
<?php
class Initial extends CakeMigration {
And that way CakeDC’s migration plugin will detect the migrations again.