Hello everyone!

We have been investing plenty of personal time and energy for many years to share our knowledge with you all. However, we now need your help to keep this blog running. All you have to do is just click one of the adverts on the site, otherwise it will sadly be taken down due to hosting etc. costs. Thank you.

This example is used for test environment and runs faster compared to MySQL version. Assuming that we have Backend and Frontend bundles and each have their own entities. The entities live in different databases so we'll need dedicated entity managers for each.


Application structure


src
Application
BackendBundle
Entity
User.php
Log.php
Activity.php
FrontendBundle
Entity
Blog.php
Visit.php

Config_test.yml


doctrine:
dbal:
connections:
backend:
driver: pdo_sqlite
path: %kernel.cache_dir%/backend.db
charset: UTF8
frontend:
driver: pdo_sqlite
path: %kernel.cache_dir%/frontend.db
charset: UTF8

Test


Inanzzz-MBP:football inanzzz$ app/console doctrine:schema:create --em=frontend --env=test
ATTENTION: This operation should not be executed in a production environment.

Creating database schema...
Database schema created successfully!
Inanzzz-MBP:football inanzzz$ app/console doctrine:schema:create --em=backend --env=test
ATTENTION: This operation should not be executed in a production environment.

Creating database schema...
Database schema created successfully!