O'Reilly logo

CakePHP 2 Application Cookbook by Jorge González, James Watts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Schema handling

CakePHP is packed with a console shell for schema management, which gives you the ability to keep your database structure defined in a schema file in your version control system. This schema file keeps track of the changes made to your database and applies schema changes without touching your current data.

A schema file is a regular PHP file, located by convention in app/Config/Schema/schema.php. This file describes your database tables using properties as one property per table. Each property holds an array with all the columns in your table, their type, and other metadata required to fully describe the table.

Getting ready

You'll need to create at least one table in your database and its associated model. The shell schema processes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required