How can we run I write Cakephp Migrations for data

2019-08-30 09:52发布

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条回答
叛逆
2楼-- · 2019-08-30 10:08

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.

查看更多
登录 后发表回答