Problem In Executing Migration

When I execute the migration command, the following error was raised in the command window.

… General error: 1 near “ENGINE”: syntax error. The SQL statement executed was : CREATE TABLE ‘my_project’ (

"id" integer PRIMARY KEY AUTOINCEMENT NOT NULL,

"name" varchar(255) NOT NULL

) ENGINE=INNODB’ in …

The content of my migration file is :

class m140811_082056_create_project_table extends CDbMigration {

public function up() {


    $this->createTable('my_project', array(


        'id' => 'pk',


        'name' => 'string NOT NULL',


            ), 'ENGINE=InnoDB');


}

I suspect that it should generate ‘id’ and ‘name’ instead of “id” and “name”.

Anyway what is the error?

This is the actual error message

Apply the above migration? (yes|no) [no]:y

*** applying m140811_082056_create_project_table

> create table my_project ...exception 'CDbException' with message 'CDbComma

nd failed to execute the SQL statement: CDbCommand failed to prepare the SQL sta

tement: SQLSTATE[HY000]: General error: 1 near "ENGINE": syntax error. The SQL s

tatement executed was: CREATE TABLE ‘my_project’ (

    "id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,


    "name" varchar(255) NOT NULL

) ENGINE=InnoDB’ in C:\xampp\htdocs\yii\framework\db\CDbCommand.php:358

Stack trace:

#0 C:\xampp\htdocs\yii\framework\db\CDbCommand.php(1324): CDbCommand->execute()

#1 C:\xampp\htdocs\yii\framework\db\CDbMigration.php(233): CDbCommand->createTab

le(‘my_project’, Array, ‘ENGINE=InnoDB’)

#2 C:\xampp\htdocs\yii\trackstar\protected\migrations\m140811_082056_create_proj

ect_table.php(14): CDbMigration->createTable(‘my_project’, Array, 'ENGINE=InnoDB

')

#3 C:\xampp\htdocs\yii\framework\cli\commands\MigrateCommand.php(385): m140811_0

82056_create_project_table->up()

#4 C:\xampp\htdocs\yii\framework\cli\commands\MigrateCommand.php(109): MigrateCo

mmand->migrateUp(‘m140811_082056_…’)

#5 [internal function]: MigrateCommand->actionUp(Array)

#6 C:\xampp\htdocs\yii\framework\console\CConsoleCommand.php(172): ReflectionMet

hod->invokeArgs(Object(MigrateCommand), Array)

#7 C:\xampp\htdocs\yii\framework\console\CConsoleCommandRunner.php(71): CConsole

Command->run(Array)

#8 C:\xampp\htdocs\yii\framework\console\CConsoleApplication.php(92): CConsoleCo

mmandRunner->run(Array)

#9 C:\xampp\htdocs\yii\framework\base\CApplication.php(180): CConsoleApplication

->processRequest()

#10 C:\xampp\htdocs\yii\framework\yiic.php(33): CApplication->run()

#11 C:\xampp\htdocs\yii\trackstar\protected\yiic.php(7): require_once('C:\xampp\

htdocs…’)

#12 {main}