本文介绍了我们如何运行我为数据库连接类型写Cakephp Migrations?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用CakeDc Migrations插件进行数据库迁移。我的应用程序使用两个数据库。所以在database.php中配置它。我写了许多迁移,它与database1(默认连接)和它的工作罚款协调。现在我想编写一个迁移,它与database2协调(我想只在database2上运行这些查询)。如何区分?

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 ?

谢谢。

推荐答案

帮助文本和文档。

--connection, -c           Overrides the 'default' connection of the
                           MigrationVersion
--migrationConnection, -i  Overrides the 'default' connection of the
                           CakeMigrations that are applied

有更多的选项,只需键入 cake migrations.migration 并阅读它显示的内容。在/ Docs文件夹中还有很多文档。

There are more options, just type cake migrations.migration and read what it shows. There is also a lot documentation in the /Docs folder.

这篇关于我们如何运行我为数据库连接类型写Cakephp Migrations?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 07:31