We have several branches of one project that share about half of the code and develop them simultaneously with git checkout. Now, the problem came when the model became so different, that it is no longer possible to keep the same database for their development. I could have specified the database name in the config/databases.yml specifically for each branch, but it is not tracked. Another solution would be to track some external file with branch name, for example, config/branch.txt, and reference it in config/databases.yml:
all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: 'pgsql:host=localhost;dbname=<?php echo file_get_contents (realpath(__DIR__ . '/branch.txt')) ?>'
Anyway, how do you tackle this?