Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Invalid
-
Affects Version/s: 2.2.2
-
Fix Version/s: None
-
Component/s: None
-
Security Level: All
-
Labels:None
Description
If I have an entity with @Column(type="array"), orm:validate-schema always tells me "FAIL - The database schema is not in sync with the current mapping file.".
If I call orm:schema-tool:update --dump-sql, I get "ALTER TABLE bridge ALTER config TYPE TEXT" although this is already how the column in my database looks like. If I execute this query, nothing happens and orm:validate-schema still fails.
There exist two different mapping types - TextType and ArrayType, but they both have the same SQL column type - TEXT.
The $fromSchema is built with TextType column, the $toSchema contains (correctly) ArrayType.
I propose not to generate the ALTER if the both compared columns' Type::getSQLDeclaration() results are the same.
If I got everything okay, I can prepare a pull request.
This is alreaady fixable by having the '(DCType:Array)' string in the comment of that column. this should automatically be generated into the comment field on MySQL and PostgreSQL by Doctrine if you use Schema tool.