mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Automatically set GENERATOR_TYPE_NONE in fixtures #5262
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @afilina on GitHub (Sep 18, 2016).
There is no easy way to set IDs when importing fixtures.
We can't truncate MySQL tables with FKs. According to project maintainers, it will never be possible: https://github.com/doctrine/DoctrineFixturesBundle/issues/50
On the other hand, setting ID generators for every single entity type is cumbersome. I teach beginners and this makes things very difficult for them.
doctrine/data-fixtures says that it's a Doctrine issue: https://github.com/doctrine/data-fixtures/issues/129#issuecomment-84693918
Thanks.
@beyerz commented on GitHub (Jun 3, 2018):
I am having this exact issue, I haven't tried it yet, but I assume you could create a custom strategy, that would take into account that the ID has already been set
@BonBonSlick commented on GitHub (Sep 10, 2018):
Hard to test when entities generated with new ids