doctrine:
    dbal:
        #url: '%env(resolve:DATABASE_URL)%'
        default_connection: default
        connections:
            default:
                driver: '%app.database_driver%'
                host: '%app.database_host%'
                dbname: '%app.cc_database%'
                user: '%app.database_username%'
                password: '%app.database_password%'
                port: '%app.database_port%'
                server_version: '12.0.5000.0'
                default_table_options:
                    #charset: CP-1252
                    #collate: SQL_Latin1_General_CP1_CI_AS
                options:
                    TrustServerCertificate: true
            vanguard:
                driver: '%app.database_driver%'
                host: '%app.database_host%'
                dbname: '%app.vanguard_database%'
                user: '%app.database_username%'
                password: '%app.database_password%'
                port: '%app.database_port%'
                server_version: '12.0.5000.0'
                options:
                    TrustServerCertificate: true
            sales:
                driver: '%app.database_driver%'
                host: '%app.database_host%'
                dbname: '%app.sales_database%'
                user: '%app.database_username%'
                password: '%app.database_password%'
                port: '%app.database_port%'
                server_version: '12.0.5000.0'
                options:
                    TrustServerCertificate: true
            customerCareApp:
                driver: '%app.database_driver%'
                host: '%app.database_host%'
                dbname: '%app.customer_care_database%'
                user: '%app.database_username%'
                password: '%app.database_password%'
                port: '%app.database_port%'
                server_version: '12.0.5000.0'
                options:
                    TrustServerCertificate: true
        # IMPORTANT: You MUST configure your server version,
        # either here or in the DATABASE_URL env var (see .env file)

    orm:
        #auto_generate_proxy_classes: true
        default_entity_manager: default
        entity_managers:
            default:
                connection: default
                naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
                #auto_mapping: true
                mappings:
                    CC:
                        is_bundle: false
                        type: attribute
                        dir: '%kernel.project_dir%/src/Entity/CC'
                        prefix: 'App\Entity\CC'
                        alias: CC
            vanguard:
                connection: vanguard
                naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
                #auto_mapping: false
                mappings:
                    Vanguard:
                        is_bundle: false
                        type: attribute
                        dir: '%kernel.project_dir%/src/Entity/Vanguard'
                        prefix: 'App\Entity\Vanguard'
                        alias: Vanguard
            sales:
                connection: sales
                naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
                #auto_mapping: false
                mappings:
                    Sales:
                        is_bundle: false
                        type: attribute
                        dir: '%kernel.project_dir%/src/Entity/Sales'
                        prefix: 'App\Entity\Sales'
                        alias: Sales
            customerCare:
                connection: customerCareApp
                naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
                #auto_mapping: false
                mappings:
                    Sales:
                        is_bundle: false
                        type: attribute
                        dir: '%kernel.project_dir%/src/Entity/CustomerCare'
                        prefix: 'App\Entity\CustomerCare'
                        alias: CustomerCare

when@test:
    doctrine:
        dbal:
            # "TEST_TOKEN" is typically set by ParaTest
            dbname_suffix: '_test%env(default::TEST_TOKEN)%'

when@prod:
    doctrine:
        orm:
            auto_generate_proxy_classes: false
            query_cache_driver:
                type: pool
                pool: doctrine.system_cache_pool
            result_cache_driver:
                type: pool
                pool: doctrine.result_cache_pool

    framework:
        cache:
            pools:
                doctrine.result_cache_pool:
                    adapter: cache.app
                doctrine.system_cache_pool:
                    adapter: cache.system
