Propel migration with multiple connections defined

一笑奈何 提交于 2019-12-13 03:06:14

问题


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 Integration of Propel in Symfony2

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


回答1:


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

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



来源:https://stackoverflow.com/questions/27487680/propel-migration-with-multiple-connections-defined

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