10/07/2015 - BEHAT, DOCTRINE, SYMFONY
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.
src
Application
BackendBundle
Entity
User.php
Log.php
Activity.php
FrontendBundle
Entity
Blog.php
Visit.php
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
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!