views:

194

answers:

1

In my project I have 2 databases. propel-build-model is already set up to work for 2 databases - http://stackoverflow.com/questions/733224/multiple-databases-support-in-symfony

If I make changes to either of the databases, I need the propel-build-schema command to rebuild the schemas for both.

I know I can do this manually by amending my settings per schema, but is it possible to create both at the same time? If so, how can I adjust my propel.ini file to have both connections?

I am currently using Symfony 1.0

+1  A: 

The propel-build-schema command uses the settings in the propel.ini file which can store the configuration of a single connection only. However, you can probably do what you want by creating a copy of your propel.ini file with a different name to store the settings of your other connection and writing a simple shell script to rename the .ini files to propel.ini as needed and invoke propel-build-schema twice so that each invocation uses the right propel.ini (your script may also need to rename the output schema.yml files as well). Should be simple to do. Then, whenever you want the schema files regenerated, just run the script.

Ree
Nice! Thanks a lot. I will try to remember to publish my created .bat file on my blog
Jon Winstanley