问题
I am using CakeDc Migrations plugin for database migration. my application is using two databases. so configured it in database.php. I have written many migrations which co-ordinate with the database1(default connection ) and its working fine. Now I want to write one migration which co-ordinate with database2(I want to run these queries only on database2 ) . how Can I differentiate? at what level ?
Thank you.
回答1:
Just read the help text and documentation.
--connection, -c Overrides the 'default' connection of the
MigrationVersion
--migrationConnection, -i Overrides the 'default' connection of the
CakeMigrations that are applied
There are more options, just type cake migrations.migration
and read what it shows. There is also a lot documentation in the /Docs folder.
来源:https://stackoverflow.com/questions/24990417/how-can-we-run-i-write-cakephp-migrations-for-database-connection-type