doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                url: '%env(resolve:DATABASE_URL)%'
                driver: 'pdo_mysql'
                server_version: 'mariadb-10.0.25'
                wrapper_class: Aes\Doctrine\DBAL\MysqlConnectionWrapper
            legacy:
                url: '%env(resolve:DATABASE_LEGACY_URL)%'
                driver: 'pdo_mysql'
                server_version: '5.7'
                wrapper_class: Aes\Doctrine\DBAL\MysqlConnectionWrapper
        types:
            datetime: Aes\Doctrine\DBAL\Types\UTCDateTimeType

    orm:
        auto_generate_proxy_classes: false
        #naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
        #auto_mapping: true
        default_entity_manager: default
        entity_managers:
            default:
                connection: default
                naming_strategy: doctrine.orm.naming_strategy.underscore
                mappings:
                    App:
                        is_bundle: false
                        type: attribute
                        dir: '%kernel.project_dir%/src/Entity'
                        prefix: 'Aes\Entity'
                        alias: Aes
            legacy:
                connection: legacy
                naming_strategy: doctrine.orm.naming_strategy.underscore
                mappings:
                    Legacy:
                        is_bundle: false
                        type: attribute
                        dir: '%kernel.project_dir%/src/Entity/Legacy'
                        prefix: 'Aes\Entity\Legacy'
                        alias: Legacy

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
