Reputation: 1001
I have followed this step by step instruction to create a table in my database using migrate command but I wondered how it is finalized at the last step. after running "yiic migrate" command I get the following message:
Yii Migration Tool v1.0 (based on Yii v1.1.13)
exception 'CDbException' with message 'CDbConnection.connectionString cannot be
empty.' in D:\wamp\www\news\framework\db\CDbConnection.php:369
Stack trace:
#0 D:\wamp\www\news\framework\db\CDbConnection.php(330): CDbConnection->open()
#1 D:\wamp\www\news\framework\db\CDbConnection.php(308): CDbConnection->setActiv
e(true)
#2 D:\wamp\www\news\framework\base\CModule.php(387): CDbConnection->init()
#3 D:\wamp\www\news\framework\cli\commands\MigrateCommand.php(442): CModule->get
Component('db')
#4 D:\wamp\www\news\framework\cli\commands\MigrateCommand.php(451): MigrateComma
nd->getDbConnection()
#5 D:\wamp\www\news\framework\cli\commands\MigrateCommand.php(482): MigrateComma
nd->getMigrationHistory(-1)
#6 D:\wamp\www\news\framework\cli\commands\MigrateCommand.php(84): MigrateComman
d->getNewMigrations()
#7 [internal function]: MigrateCommand->actionUp(Array)
#8 D:\wamp\www\news\framework\console\CConsoleCommand.php(172): ReflectionMethod
->invokeArgs(Object(MigrateCommand), Array)
#9 D:\wamp\www\news\framework\console\CConsoleCommandRunner.php(67): CConsoleCom
mand->run(Array)
#10 D:\wamp\www\news\framework\console\CConsoleApplication.php(91): CConsoleComm
andRunner->run(Array)
#11 D:\wamp\www\news\framework\base\CApplication.php(169): CConsoleApplication->
processRequest()
#12 D:\wamp\www\news\framework\yiic.php(33): CApplication->run()
#13 D:\wamp\www\news\framework\yiic(14): require_once('D:\wamp\www\new...')
#14 {main}
I don't know what command I have to run after it and how to finish up with the migration process!
Does anybody have a solution on this issue? (I am also using windows 7)
Upvotes: 2
Views: 998
Reputation: 1519
Inside config/console.php add database configuration
'components' => array(
'db'=> array(
'connectionString' => '',
'username' => '',
'password' => '',
)
)
with appropriate database details
Upvotes: 2
Reputation: 8587
You seem to miss the db
configuration block in your config/console.php
.
Upvotes: 0