sonata-project / EntityAuditBundle

Audit for Doctrine Entities
https://sonata-project.org
MIT License
633 stars 261 forks source link

Wrong behavior with Symfony doctrine:migrations:diff command #306

Closed aibragimov4xxi closed 3 years ago

aibragimov4xxi commented 7 years ago
Q A
Bug report? yes
Feature request? no
BC Break report? no
Used Version e.g. 1.0.1

I annotated my entity as Auditable, then I tried to use php bin/console doctrine:migrations:diff command. But in new migration there was many audit tables for another entities (which were not auditable) but no table for my auditable entity.

How can I get correct migration from Auditable annotation?

mattchete commented 5 years ago

@aibragimov4xxi Did you find any solution?

emr commented 5 years ago

Same problem here (v1.0.9). But the problem not related to doctrine migrations. I think related to Symfony service container and the simplethings.entityaudit.audited_entities parameter bundle's uses.

emr commented 5 years ago

I found where simplethings.entityaudit.audited_entities parameter is modified. See: https://github.com/sonata-project/SonataDoctrineORMAdminBundle/blob/3.x/src/DependencyInjection/Compiler/AddAuditEntityCompilerPass.php#L52

SonataDoctrineORMAdminBundle modifies it. You can disable this behavior with that bundle's configuration:

sonata_doctrine_orm_admin:
    audit:
        force: false
github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.