I have two database connections in config.yml and two entity managers. Each are tied to a bundle.
The issue that I'm having is running unit tests, which start by creating a blank db and loading in data. It's creating both databases but i'm getting both sets of tables in each database, instead of one set of entities in one db and one in the other. Since two db connections isn't incredibly common, I'm having trouble finding some help on this.
doctrine:
dbal:
default_connection: default
...
connections:
default:
(conectioninfo)
seconddb:
(connectioninfo)
orm:
default_entity_manager: default
auto_generate_proxy_classes: "%kernel.debug%"
entity_managers:
default:
connection: default
mappings:
MycompanyCoreBundle: ~
seconddb:
connection: seconddb
mappings:
MycomanySecondBundle: ~
When running unit tests, the lines I have are:
php app/console doctrine:database:drop --force --env=test --connection=default
php app/console doctrine:database:create --env=test --connection=default
php app/console doctrine:schema:drop --force --no-interaction --env=test --em=default
php app/console doctrine:schema:update --force --no-interaction --env=test --em=default
php app/console doctrine:database:drop --force --env=test --connection=seconddb
php app/console doctrine:database:create --env=test --connection=seconddb
php app/console doctrine:schema:drop --force --no-interaction --env=test --em=seconddb
php app/console doctrine:schema:update --force --no-interaction --env=test --em=seconddb
When running all this, the output is
Successfully deleted cache entries.
Dropping database schema...
Database schema dropped successfully!
Updating database schema...
Database schema updated successfully! "91" queries were executed
The problem is that those 91 queries are a combination of both Entity folders in the two bundles. I'm missing somewhere to point them separately so they go into their respective databases.