The reasons to use Roger with dedicated database are:
Roger has a fairly big model, especially its own model of users, and some similar bundles (eg. blogs) may use similar tables. Separating databases keeps you safe.
We often work in teams, and working with an CMS requires constant synchronisations of database. To keep the amount of the data transfered to minimum, you have to synchronize only cms tables. Having your databases separated allows you to do this in few easy steps.
- Define your connection (all changes take place in config yml)
doctrine:
dbal:
connections:
...
cms:
driver: %cms.database_driver%
host: %cms.database_host%
dbname: %cms.database_name%
user: %cms.database_user%
password: %cms.database_password%
charset: UTF8
- Add an entity manager to this connection:
doctrine:
orm:
auto_generate_proxy_classes: %kernel.debug%
entity_managers:
...
cms:
connection: cms
mappings:
TheodoRogerCmsBundle: ~
StofDoctrineExtensionsBundle: false
- Add the timestampable behaviour to that entity manager
stof_doctrine_extensions:
default_locale: en_US
orm:
...
cms:
timestampable: true
tree: false
sluggable: false
translatable: false
loggable: false
- Overwrite Roger services to use your new entity manager Replace all occurences of '@doctrine.orm.entity_manager' in Roger's services.yml by '@doctrine.orm.cms_entity_manager'
Don't forget to add --em=orm or --connection=orm when calling doctrine tasks using cms (schema creation, fixtures loading etc.)!