doctrine:
    dbal:
        url: '%env(resolve:DATABASE_URL)%'
        profiling_collect_backtrace: '%kernel.debug%'

    orm:
        validate_xml_mapping: true
        naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
        auto_mapping: true
        mappings:
            # Infrastructure mappings - keep entities separate from Domain
            Administration:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Administration/Infrastructure/Persistence/Mapping'
                prefix: 'App\Administration\Infrastructure\Persistence\Mapping'
                alias: Administration
            Scolarite:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Scolarite/Infrastructure/Persistence/Mapping'
                prefix: 'App\Scolarite\Infrastructure\Persistence\Mapping'
                alias: Scolarite
            VieScolaire:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/VieScolaire/Infrastructure/Persistence/Mapping'
                prefix: 'App\VieScolaire\Infrastructure\Persistence\Mapping'
                alias: VieScolaire
            Communication:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/Communication/Infrastructure/Persistence/Mapping'
                prefix: 'App\Communication\Infrastructure\Persistence\Mapping'
                alias: Communication
            SuperAdmin:
                type: attribute
                is_bundle: false
                dir: '%kernel.project_dir%/src/SuperAdmin/Infrastructure/Persistence/Mapping'
                prefix: 'App\SuperAdmin\Infrastructure\Persistence\Mapping'
                alias: SuperAdmin
        controller_resolver:
            auto_mapping: false

when@test:
    doctrine:
        dbal:
            dbname_suffix: '_test%env(default::TEST_TOKEN)%'

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