问题
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