Directive - Create Field
Details
Name: create_field
Format: array of [Migration Fields](/cakedc/migrations/wiki/migration-fields)
Description
Create Field is used to add fields to an existing table in the schema.
Note that migrations will generate errors if the specified field already exists in the table.
Directives exist (Drop, Rename, Alter) to deal with existing fields before proceeding with field addition.
Example
'create_field' => array(
'categories' => array(
'created' => array(
'type' => 'datetime'),
'modified' => array(
'type' => 'datetime')
)
)
This will result in the addition of a created and modified field to the categories table.