diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index 75ec9e8..d72f5ad 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -1,29 +1,49 @@ doctrine: dbal: - url: '%env(resolve:DATABASE_URL)%' + connections: + default: + url: '%env(resolve:DATABASE_URL)%' + profiling_collect_backtrace: '%kernel.debug%' + use_savepoints: true + transfer: + url: '%env(default::XFER_DATABASE_URL)%' + profiling_collect_backtrace: '%kernel.debug%' + use_savepoints: true # IMPORTANT: You MUST configure your server version, # either here or in the DATABASE_URL env var (see .env file) #server_version: '16' - profiling_collect_backtrace: '%kernel.debug%' - use_savepoints: true orm: auto_generate_proxy_classes: true enable_lazy_ghost_objects: true - report_fields_where_declared: true - validate_xml_mapping: true - naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware - auto_mapping: true - mappings: - App: - type: attribute - is_bundle: false - dir: '%kernel.project_dir%/src/Entity' - prefix: 'App\Entity' - alias: App + # report_fields_where_declared: true + # validate_xml_mapping: true + # auto_mapping: true + default_entity_manager: default + entity_managers: + default: + connection: default + naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware + mappings: + App: + type: attribute + is_bundle: false + dir: '%kernel.project_dir%/src/Entity' + prefix: 'App\Entity' + alias: App + transfer: + connection: transfer + naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware + mappings: + App: + type: attribute + is_bundle: false + dir: '%kernel.project_dir%/src/Entity' + prefix: 'App\Entity' + alias: App controller_resolver: - auto_mapping: true + auto_mapping: false when@test: doctrine: @@ -50,3 +70,6 @@ when@prod: adapter: cache.app doctrine.system_cache_pool: adapter: cache.system + +parameters: + env(default_url): '' \ No newline at end of file diff --git a/config/services.yaml b/config/services.yaml index 2d6a76f..ce0a377 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -22,3 +22,6 @@ services: # add more service definitions when explicit configuration is needed # please note that last definitions always *replace* previous ones + App\Service\DatabaseTransferService: + arguments: + $projectDir: '%kernel.project_dir%' \ No newline at end of file