How can we run I write Cakephp Migrations for database connection type?

£可爱£侵袭症+ 提交于 2019-12-12 02:02:33

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!