Automatically set GENERATOR_TYPE_NONE in fixtures #5262

Open
opened 2026-01-22 15:02:53 +01:00 by admin · 2 comments
Owner

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.

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.
Author
Owner

@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

@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
Author
Owner

@BonBonSlick commented on GitHub (Sep 10, 2018):

Hard to test when entities generated with new ids

@BonBonSlick commented on GitHub (Sep 10, 2018): Hard to test when entities generated with new ids
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5262