CakeSchema类是基类的所有数据库模式。每一个模式类可以生成一组表。模式shell控制台类SchemaShell lib /蛋糕/控制台命令目录中的解释命令行,和基地模式类可以从数据库读取,或者生成数据库表。
CakeSchema现在可以定位,读写模式文件的插件。SchemaShell也暴露了这个功能。
CakeSchema还支持tableParameters。表参数非列特定表等信息排序,字符集,评论,和表引擎类型。每个Dbo实现tableParameters他们支持。
例子
这是一个从acl类完整的示例
每一列作为键值编码关联数组中。字段的字段名是关键,是另一个数组的值以下属性。
例子列
CakeSchema现在可以定位,读写模式文件的插件。SchemaShell也暴露了这个功能。
CakeSchema还支持tableParameters。表参数非列特定表等信息排序,字符集,评论,和表引擎类型。每个Dbo实现tableParameters他们支持。
例子
这是一个从acl类完整的示例
/**
* ACO - Access Control Object - Something that is wanted
*/
public $acos = array(
'id' => array(
'type' => 'integer',
'null' => false,
'default' => null,
'length' => 10,
'key' => 'primary'
),
'parent_id' => array(
'type' => 'integer',
'null' => true,
'default' => null,
'length' => 10
),
'model' => array('type' => 'string', 'null' => true),
'foreign_key' => array(
'type' => 'integer',
'null' => true,
'default' => null,
'length' => 10
),
'alias' => array('type' => 'string', 'null' => true),
'lft' => array(
'type' => 'integer',
'null' => true,
'default' => null,
'length' => 10
),
'rght' => array(
'type' => 'integer',
'null' => true,
'default' => null,
'length' => 10
),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);
列
每一列作为键值编码关联数组中。字段的字段名是关键,是另一个数组的值以下属性。
例子列
'id' => array(
'type' => 'integer',
'null' => false,
'default' => null,
'length' => 10,
'key' => 'primary'
),
key
The primary key defines the primary key index.
null
Is the field nullable?
default
What is the default value of the field?
limit
The limit of the type of the field.
length
What is the length of the field?
type
One of the following types
integer
date
time
datetime
timestamp
boolean
biginteger
float
string
text
binary