Hi guys,
I’m having some problens when I try to create new migrations.
I created a new application using version 1.0.10 of yii, and when I try create a new migration, the console show this error:
Migrations directory: protected/migrations/
Creating initial schema_version table
PHP Error[2]: PDOStatement::execute() expects parameter 1 to be array, string given
in file /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/db/CDbCommand.php at line 352
#0 CConsoleApplication->displayError(2, PDOStatement::execute() expects parameter 1 to be array, string given, /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/db/CDbCommand.php, 352) called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/base/CErrorHandler.php:204]
#1 CErrorHandler->handleError(CErrorEvent Object ([code] => 2,[message] => PDOStatement::execute() expects parameter 1 to be array, string given,[file] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/db/CDbCommand.php,[line] => 352,[sender] => CConsoleApplication Object ([commandMap] => Array ([migrate] => Array ([class] => application.extensions.yii-dbmigrations.CDbMigrationCommand)),[] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/public/protected/commands,[] => CConsoleCommandRunner Object ([commands] => Array ([migrate] => Array ([class] => application.extensions.yii-dbmigrations.CDbMigrationCommand),[message] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/cli/commands/MessageCommand.php,[shell] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/cli/commands/ShellCommand.php,[webapp] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/cli/commands/WebAppCommand.php),[] => ./protected/yiic,[] => ,[] => ),[name] => My Console Application,[charset] => UTF-8,[sourceLanguage] => en_us,[] => ,[] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/public/protected,[] => ,[] => ,[] => ,[] => ,[] => ,[] => ,[preload] => Array (),[behaviors] => Array (),[] => ,[] => ,[] => ,[] => ,[] => ,[] => Array (),[] => Array (),[] => Array ([db] => CDbConnection Object ([connectionString] => mysql:host=localhost;dbname=nagloria;unix_socket=/tmp/mysql.sock,[username] => root,[password] => ,[schemaCachingDuration] => 0,[schemaCachingExclude] => Array (),[schemaCacheID] => cache,[autoConnect] => 1,[charset] => ,[emulatePrepare] => 1,[enableParamLogging] => ,[enableProfiling] => ,[] => Array (),[] => 1,[] => PDO Object (),[] => ,[] => CMysqlSchema Object ([] => ,[] => ,[] => Array (),[] => Array ([schema_version] => ),[] => CDbConnection Object ( *RECURSION*,[] => ,[] => Array (),[] => ,[] => ),[behaviors] => Array (),[] => 1,[] => ,[] => ),[coreMessages] => CPhpMessageSource Object ([cachingDuration] => 0,[cacheID] => cache,[basePath] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/messages,[] => Array (),[] => en_us,[] => Array (),[behaviors] => Array (),[] => 1,[] => ,[] => ),[errorHandler] => CErrorHandler Object ([maxSourceLines] => 25,[adminInfo] => the webmaster,[discardOutput] => 1,[errorAction] => ,[] => ,[behaviors] => Array (),[] => 1,[] => ,[] => )),[] => Array ([messages] => Array ([class] => CPhpMessageSource),[securityManager] => Array ([class] => CSecurityManager),[statePersister] => Array ([class] => CStatePersister),[urlManager] => Array ([class] => CUrlManager),[request] => Array ([class] => CHttpRequest)),[] => ,[] => ),[handled] => 1,[] => ,[] => )) called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/base/CErrorHandler.php:96]
#2 CErrorHandler->handle(CErrorEvent Object ([code] => 2,[message] => PDOStatement::execute() expects parameter 1 to be array, string given,[file] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/db/CDbCommand.php,[line] => 352,[sender] => CConsoleApplication Object ([commandMap] => Array ([migrate] => Array ([class] => application.extensions.yii-dbmigrations.CDbMigrationCommand)),[] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/public/protected/commands,[] => CConsoleCommandRunner Object ([commands] => Array ([migrate] => Array ([class] => application.extensions.yii-dbmigrations.CDbMigrationCommand),[message] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/cli/commands/MessageCommand.php,[shell] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/cli/commands/ShellCommand.php,[webapp] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/cli/commands/WebAppCommand.php),[] => ./protected/yiic,[] => ,[] => ),[name] => My Console Application,[charset] => UTF-8,[sourceLanguage] => en_us,[] => ,[] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/public/protected,[] => ,[] => ,[] => ,[] => ,[] => ,[] => ,[preload] => Array (),[behaviors] => Array (),[] => ,[] => ,[] => ,[] => ,[] => ,[] => Array (),[] => Array (),[] => Array ([db] => CDbConnection Object ([connectionString] => mysql:host=localhost;dbname=nagloria;unix_socket=/tmp/mysql.sock,[username] => root,[password] => ,[schemaCachingDuration] => 0,[schemaCachingExclude] => Array (),[schemaCacheID] => cache,[autoConnect] => 1,[charset] => ,[emulatePrepare] => 1,[enableParamLogging] => ,[enableProfiling] => ,[] => Array (),[] => 1,[] => PDO Object (),[] => ,[] => CMysqlSchema Object ([] => ,[] => ,[] => Array (),[] => Array ([schema_version] => ),[] => CDbConnection Object ( *RECURSION*,[] => ,[] => Array (),[] => ,[] => ),[behaviors] => Array (),[] => 1,[] => ,[] => ),[coreMessages] => CPhpMessageSource Object ([cachingDuration] => 0,[cacheID] => cache,[basePath] => /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/messages,[] => Array (),[] => en_us,[] => Array (),[behaviors] => Array (),[] => 1,[] => ,[] => ),[errorHandler] => CErrorHandler Object ([maxSourceLines] => 25,[adminInfo] => the webmaster,[discardOutput] => 1,[errorAction] => ,[] => ,[behaviors] => Array (),[] => 1,[] => ,[] => )),[] => Array ([messages] => Array ([class] => CPhpMessageSource),[securityManager] => Array ([class] => CSecurityManager),[statePersister] => Array ([class] => CStatePersister),[urlManager] => Array ([class] => CUrlManager),[request] => Array ([class] => CHttpRequest)),[] => ,[] => ),[handled] => 1,[] => ,[] => )) called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/base/CApplication.php:630]
#3 CApplication->handleError(2, PDOStatement::execute() expects parameter 1 to be array, string given, /Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/db/CDbCommand.php, 352, Array ([this] => CDbCommand Object ([] => CDbConnection Object ([connectionString] => mysql:host=localhost;dbname=nagloria;unix_socket=/tmp/mysql.sock,[username] => root,[password] => ,[schemaCachingDuration] => 0,[schemaCachingExclude] => Array (),[schemaCacheID] => cache,[autoConnect] => 1,[charset] => ,[emulatePrepare] => 1,[enableParamLogging] => ,[enableProfiling] => ,[] => Array (),[] => 1,[] => PDO Object (),[] => ,[] => CMysqlSchema Object ([] => ,[] => ,[] => Array (),[] => Array ([schema_version] => ),[] => CDbConnection Object ( *RECURSION*,[] => ,[] => Array (),[] => ,[] => ),[behaviors] => Array (),[] => 1,[] => ,[] => ),[] => SELECT `id` FROM `schema_version` ORDER BY `id`,[] => PDOStatement Object ([queryString] => SELECT `id` FROM `schema_version` ORDER BY `id`),[] => Array (),[] => ,[] => ),[method] => fetchAll,[mode] => 7,[params] => id,[par] => ))
#4 PDOStatement->execute(id) called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/db/CDbCommand.php:352]
#5 CDbCommand->queryInternal(fetchAll, 7, id) called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/db/CDbCommand.php:321]
#6 CDbCommand->queryColumn(id) called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/public/protected/extensions/yii-dbmigrations/CDbMigrationEngine.php:187]
#7 CDbMigrationEngine->getAppliedMigrations() called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/public/protected/extensions/yii-dbmigrations/CDbMigrationEngine.php:295]
#8 CDbMigrationEngine->applyMigrations(create) called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/public/protected/extensions/yii-dbmigrations/CDbMigrationEngine.php:86]
#9 CDbMigrationEngine->run(Array ([0] => create,[1] => users)) called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/public/protected/extensions/yii-dbmigrations/CDbMigrationCommand.php:99]
#10 CDbMigrationCommand->run(Array ([0] => create,[1] => users)) called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/console/CConsoleCommandRunner.php:62]
#11 CConsoleCommandRunner->run(Array ([0] => ./protected/yiic,[1] => migrate,[2] => create,[3] => users)) called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/console/CConsoleApplication.php:88]
#12 CConsoleApplication->processRequest() called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/base/CApplication.php:135]
#13 CApplication->run() called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/yiic.php:31]
#14 require_once(/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/yii/yiic.php) called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/public/protected/yiic.php:7]
#15 require_once(/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/public/protected/yiic.php) called at [/Volumes/MAFIOUS/14bits/src/nagloria/trunk/web/public/protected/yiic:4]
I 'm calling this line on command line:
$ ./protected/yiic migrate create users
And the configuration is that:
'commandMap' => array('migrate' => array('class' => 'application.extensions.yii-dbmigrations.CDbMigrationCommand')),
'components' => array('db' => array('class' => 'system.db.CDbConnection',
'connectionString' => 'mysql:host=localhost;dbname=nagloria;unix_socket=/tmp/mysql.sock',
'username' => 'root',
'password' => '',
'emulatePrepare' => true)),
I did some tests with version 1.0.8 of yii and the extansion run well, but with 1.0.10 the problem happened.
Could you help me to fix up this?
Thanks.