Suppose you have a Bundle that uses a MySQL database, which is located inside a folder in the src directory, for example:
src/Folder/BundleFolder/
And another Bundle that uses the Postgresql database, which is in your src directory, say:
src/OtherBundle
To map the doctrine to a specific entity manager, use this conf in the app / config / config.yml file:
orm: #auto_mapping: true #default_entity_manager: default entity_managers: default: connection: mysql mappings: FolderBundleFolder : ~ other: connection: pgsql mappings: OtherBundle : ~
Then, as user 3580495, use the command:
php app/console doctrine:schema:create
to find out what happens in the postgresql database.
php app/console doctrine:schema:update --em=default --dump-sql
will show you the SQL commands that will be executed in the MySQL database.
In the conf conf file, don't forget the comment as follows:
#auto_mapping: true
It also means that when you use this doctrine update command, you will need to refine your entity manager each time, which gives you more control over what you are doing as a whole.
Remember that the -help option is always your friend for symfony commands, and you will also find a lot of information in the docs:
http://symfony.com/doc/current/cookbook/doctrine/multiple_entity_managers.html