Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No mapping information to process when using DoctrineMigrationsBundle #398

Open
Derison opened this issue Jan 3, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Derison
Copy link

Derison commented Jan 3, 2024

Q A
auditor-bundle version 5.2.5
PHP version 8.2
Database PostgreSQL

Summary

I am trying to create a schema from the audit bundle while using multiple entity managers. This is my current configuration (simplified):

# doctrine.yaml

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
            # ...
            audit:
                driver: pdo_pgsql
                url: '%env(resolve:AUDIT_DATABASE_URL)%'

    orm:
        auto_generate_proxy_classes: true
        default_entity_manager: default
        entity_managers:
            default:
            # ...
            audit:
                connection: audit
                naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware

doctrine_migrations_multiple_database:
    entity_managers:
        default:
            migrations_paths:
                'App\Migrations\Default': '%kernel.project_dir%/src/Migrations/Default'
        audit:
            migrations_paths:
                'App\Migrations\Audit': '%kernel.project_dir%/src/Migrations/Audit'
# dh_auditor.yaml

# Full configuration reference available at:
# https://damienharper.github.io/auditor-docs/docs/auditor-bundle/configuration/reference.html
dh_auditor:
    enabled: true
    timezone: Europe/Berlin
    role_checker: 'dh_auditor.role_checker'
    user_provider: 'dh_auditor.user_provider'
    security_provider: 'dh_auditor.security_provider'
    providers:
        doctrine:
            viewer: true
            table_prefix: null
            table_suffix: '_audit'
            ignored_columns:
            # ...

            # storage entity managers (storage services)
            storage_services:
                - '@doctrine.orm.audit_entity_manager'

            # auditing entity managers (auditing services)
            auditing_services:
                - '@doctrine.orm.default_entity_manager'

Current behavior

I am not able to create migrations with the DoctrineMigrationsBundle since the command terminates with the error message:

# bin/console d:m:diff --em=audit

In NoMappingFound.php line 13:

  No mapping information to process


doctrine:migrations:diff [--namespace NAMESPACE] [--filter-expression FILTER-EXPRESSION] [--formatted] [--line-length LINE-LENGTH] [--check-database-platform [CHECK-DATABASE-PLATFORM]] [--allow-empty-diff] [--from-empty-schema] [--em EM]

How to reproduce

Use the DoctrineMigrationsBundle in combination with the DoctrineMigrationsMultipleDatabaseBundle and configure multiple connections and entity managers. Then try to create migrations for the entity manager you've configured as storage service for the auditor bundle.

Expected behavior

Create migrations with the DoctrineMigrationsBundle.

@Derison Derison added the bug Something isn't working label Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant