mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
MySQL80Platform requires the values of a ENUM column to be specified when using enum DiscriminatorColumn #7462
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 @whataboutpereira on GitHub (Jan 18, 2025).
Using enum in DiscriminatorColumn:
When generating a migration, this yields:
I see
AbstractMySQLPlatform.php->getEnumDeclarationSQL()receives these (first one has values populated, second one has no values, but enumType is specified, that the first one doesn't have):@derrabus commented on GitHub (Jan 21, 2025):
We indeed don't support extracting the enum cases in discriminator columns yet, but I don't see why we shouldn't. Do you want to work on this feature?
@whataboutpereira commented on GitHub (Jan 23, 2025):
It turned out easier to get working than I expected. I'm not sure how to go about testing it though.
@derrabus commented on GitHub (Jan 23, 2025):
You can have a look at our existing functional test suite. You would basically create an entity model that reproduces your problem and write code that persists and fetches data using that model.
@whataboutpereira commented on GitHub (Jan 24, 2025):
Added tests now as well.