doctrine / data-fixtures

Doctrine2 ORM Data Fixtures Extensions
http://www.doctrine-project.org
MIT License
2.78k stars 224 forks source link

Add listener table prefix #313

Open emass293 opened 5 years ago

emass293 commented 5 years ago

I add a listener to doctrine like this : https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/cookbook/sql-table-prefixes.html When I use 'doctrine:fixtures:load' , there is no call to the listener. the listenert works well with 'doctrine:schema:create' and work with the application

gubler commented 2 years ago

I posted this comment to DoctrineFixturesBundle before I saw this issue here by the same user. Adding it here for additional information.


This is a problem I am running into as well. But weirdly, with only a single entity (my user entity). All other entities are working fine. And using the same process in another application the prefix works fine with all of my Entities.

When I use the example from the Doctrine cookbook for adding table prefixes (https://www.doctrine-project.org/projects/doctrine-orm/en/2.11/cookbook/sql-table-prefixes.html) and I go to my site I can see in the Symfony debug bar that the prefix is used by Doctrine for my User entity.

However, when I try to load fixtures (via doctrine:fixtures:load) the prefix is not used (for either persisting or for reading from the database). Essentially, the loadMetaData event is not getting emitted for only my User entity, and only when using fixtures.

Its not a caching issue because I just got a new computer and this problem existed on the old computer and now the new one after a fresh install of the code and composer install.

I am sure this is something weird that I've done, but I can't find where. Nothing I can see is different with the User entity vs. other entities that are getting the prefix added. Any ideas where I should look to find out what is going weird?