php - How do each entity be generated in their respective database? -
there 2 entities: profiles
, cars
.
the entity profiles
related table in database x
, entity cars
related table in database y
.
the doctrine configuration:
doctrine: dbal: default_connection: cars connections: profiles: driver: pdo_mysql host: "%database_host_profiles%" port: "%database_port_profile%" dbname: "%database_name_profiles%" user: "%database_user_profiles%" password: "%database_password_profile%" charset: utf8 cars: driver: pdo_mysql host: "%database_host_cars%" port: "%database_port_cars%" dbname: "%database_name_cars%" user: "%database_user_cars%" password: "%database_password_cars%" charset: utf8 orm: auto_generate_proxy_classes: "%kernel.debug%" naming_strategy: doctrine.orm.naming_strategy.underscore connection: cars auto_mapping: true
when run following command, 2 entities generated in same database (cars):
app/console doctrine:schema:update
how each entity generated in respective database?
you have define entity managers in orm section , map bundles want manage not default em :
orm: entity_managers: profiles: auto_mapping: true connection: default cars: connection: other_connexion mappings: acmebundle1: ~ acmebundle2: ~
Comments
Post a Comment