如果你仍然想成功,这里是你可以尝试的。
MySQL 默认使用驱动程序 CMysqlSchema。您需要使用自定义抽象列类型扩展此类。
class MyCustomMysqlSchema extends CMysqlSchema
{
/**
* @var array the abstract column types mapped to physical column types.
*/
public $columnTypes=array(
'pk' => 'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY',
'string' => 'varchar(255)',
'text' => 'text',
'integer' => 'int(11)',
'float' => 'float',
'decimal' => 'decimal',
'datetime' => 'datetime',
'timestamp' => 'timestamp',
'time' => 'time',
'date' => 'date',
'binary' => 'blob',
'boolean' => 'tinyint(1)',
'money' => 'decimal(19,4)',
// add your custom abstract column types here
'yn' => 'tinyint(1) UNSIGNED NOT NULL DEFAULT 1',
);
}
您需要连接才能使用这个新驱动程序。如下修改您的数据库配置。
'db'=>array(
// your initial db configuration here
'driverMap'=>array('mysql'=>'MyCustomMysqlSchema'),
),