20.11.2014 Views

O Guia Definitivo do Yii 1.1

O Guia Definitivo do Yii 1.1

O Guia Definitivo do Yii 1.1

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

yiic migrate up --migrationPath=ext.forum.migrations<br />

Configure Command Globally<br />

While command line options allow us to configure the migration command on-the-fly,<br />

sometimes we may want to configure the command once for all. For example, we may<br />

want to use a different table to store the migration history, or we may want to use a<br />

customized migration template. We can <strong>do</strong> so by modifying the console application's<br />

configuration file like the following,<br />

return array(<br />

......<br />

'commandMap'=>array(<br />

'migrate'=>array(<br />

'class'=>'system.cli.commands.MigrateCommand',<br />

'migrationPath'=>'application.migrations',<br />

'migrationTable'=>'tbl_migration',<br />

'connectionID'=>'db',<br />

'templateFile'=>'application.migrations.template',<br />

),<br />

......<br />

),<br />

......<br />

);<br />

Now if we run the migrate command, the above configurations will take effect without<br />

requiring us to enter the command line options every time.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!