up()
Yii を使用して移行を行い、メソッドで新しいテーブルを作成しようとしています。ENGINE=InnoDB
句を追加しない限り、正常に動作します。その場合、エラーが発生しますnear ENGINE
。
public function up()
{
$this->createTable('tbl_project', array(
'id' => 'pk',
'name' => 'string NOT NULL',
'description' => 'text NOT NULL',
'create_time' => 'datetime DEFAULT NULL',
'create_user_id' => 'int(11) DEFAULT NULL',
'update_time' => 'datetime DEFAULT NULL',
'update_user_id' => 'int(11) DEFAULT NULL',
), 'ENGINE=InnoDB');
}
私の Yii のバージョンは 1.1.12 です。PHP 5.4.3、MySQL 5.5.24。
それはYiiのバグですか?
編集 (yii バグの説明):
*** applying m130208_133533_create_table_project
> create table tbl_project ...exception 'CDbException' with message 'CDbComm
and failed to execute the SQL statement: CDbCommand failed to prepare the SQL st
atement: SQLSTATE[HY000]: General error: 1 near "engine": syntax error. The SQL
statement executed was: CREATE TABLE 'tbl_project' (
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
"name" varchar(255) NOT NULL,
"description" text NOT NULL,
"create_time" datetime DEFAULT NULL,
"create_user_id" int(11) DEFAULT NULL,
"update_time" datetime DEFAULT NULL,
"update_user_id" int(11) DEFAULT NULL
) engine = InnoDB' in C:\wamp\yii\framework\db\CDbCommand.php:357