使用定义的多个连接推进迁移 [英] Propel migration with multiple connections defined

查看:48
本文介绍了使用定义的多个连接推进迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在 config.yml 中定义了多个连接,我是否可以只迁移一个数据库如果我跑propel:migration:diff --connection=a 它仍然希望为所有定义的数据库生成迁移.我的供应商

Is there any chance I can migrate only one database, if I have define multiple connections in my config.yml If I run propel:migration:diff --connection=a it still want to generate migration for all databases defined. My vendors

propel/propel-bundle 1.2.7 Symfony2 中Propel 的集成

propel/propel-bundle 1.2.7 Integration of Propel in Symfony2

propel/propel1 1.6.9 Propel 是 PHP5 的开源对象关系映射 (ORM).

propel/propel1 1.6.9 Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

推荐答案

是的,你可以.虽然我有 Propel 1.7.1,但我认为这自 1.6.9 以来没有改变.您必须为每个连接创建一个单独的 buildtime-conf.xml 文件,然后在调用 propel-gen diff 时将路径传递到该文件.因此,假设您有 a-buildtime-conf.xml:

Yes, you can. Although I have Propel 1.7.1 I don't think this has changed since 1.6.9. You have to create a separate buildtime-conf.xml file for each connection and then pass the path to this file while calling propel-gen diff. So, let's say you have a-buildtime-conf.xml:

propel-gen . diff -Dpropel.buildtime.conf.file=a-buildtime-conf.xml

我是通过调试 GeneratorConfig::getBuildConnections() 方法发现的.

I found this by debugging the GeneratorConfig::getBuildConnections() method.

这篇关于使用定义的多个连接推进迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆