mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
orm:schema-tool:update tries to change columns without changes #5151
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 @DASPRiD on GitHub (Jun 11, 2016).
While working a little with custom types in Doctrine lately, I recently noticed a bug in the
Comparator, although its roots are deeper down. Consider having a custom type like this:Now, when using that type in an entity, at first when generating the database SQL and inserting it, everything is fine. The column has the correct type (binary, fixed 16) and a comment denoting the "CustomType" type.
The problem now is when asking the schema-tool for a diff. Even though the column using that type wasn't changed, the schema-tool suggests an ALTER TABLE statement, changing the column to exactly what it already is.
I looked a bit into this, and it seems that the problem is that the
Schemagenerated from the mapping files does not include the columns comment, length, fixed status and also that the type in theSchemacoming from the DB hasBinaryas type, instead ofCustomType. This lets theComparatorthink it needs to update the column.This problem looks rather complex to me, and I have no real idea on how to solve this, maybe someone else who has a better insight can analyse this further.
@beberlei commented on GitHub (Jun 12, 2016):
@DASPRiD This is a DBAL issue, please re-open the ticket there.
@DASPRiD commented on GitHub (Jun 12, 2016):
Re-created the issue under doctrine/dbal: https://github.com/doctrine/dbal/issues/2411