mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
When using a backed enum, Doctrine always generates diff to change column type #7108
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 @emodric on GitHub (Feb 7, 2023).
Bug Report
Summary
doctrine:schema:updatecommand constantly generates diff to change column type of my backed enum.Current behavior
How to reproduce
My property:
My enum:
Expected behavior
I would expect that
doctrine:schema:updatecommand reports no changes in the diff.@yceruto commented on GitHub (Mar 22, 2023):
Facing the same issue... It appears that the command is unable to detect the enum type when creating the schema for comparison (the one from the database). However, the schema from the metadata detects it correctly and stores this information in
_customSchemaOptions['enumType']. As a result, the schemas do not match, and a difference always exists.The question at hand is whether we should add
enumTypeas a known column option inDoctrine\ORM\Tools\SchemaTool::KNOWN_COLUMN_OPTIONSto prevent this persistent difference.@kkevindev commented on GitHub (Apr 4, 2023):
Seems to be a problem with
doctrine/dbal@2,doctrine/dbal@3should fix it. See https://github.com/Sylius/Sylius/issues/14097 for reference.What is your
doctrine/dbalversion @emodric?@emodric commented on GitHub (Apr 4, 2023):
It's indeed latest 2.x, but I can't migrate to v3, due to some deps relying on 2.x.
@derrabus commented on GitHub (Apr 4, 2023):
Okay, is anyone here having this issue with DBAL 3? Otherwise, I don't think we should waste any more time on this issue.
@emodric commented on GitHub (Apr 5, 2023):
@derrabus Does this mean that this will not be fixed in DBAL 2.x? Is DBAL 2.x not maintained any more?
@greg0ire commented on GitHub (Apr 5, 2023):
2 days ago was the first anniversary of DBAL 2.x not being maintained: https://www.doctrine-project.org/2022/01/22/sunsetting-dbal-2.html
Consider upgrading.
@emodric commented on GitHub (Apr 5, 2023):
Whoops, I was not aware :)
As I said, a dependncy is blocking the upgrade, so not much I can do about it, unfortunately.
Thanks anyway!
@derrabus commented on GitHub (Apr 5, 2023):
You can encourage or help the maintainer of that dependency to unblock you or replace that dependency in your codebase. This is what you can do and that's more than we can do in that regard. 🙂
@emodric commented on GitHub (Apr 6, 2023):
Yep, that's all I can do at this point!