I am trying to add a custom type class for an enum-column to Doctrine, just like in https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/cookbook/mysql-enums.html#solution-2-defining-a-type This type is properly recognized in my schema/annotations, however it is breaks if it is actually used in the database.
I.e., if the column has a different type (f.e. after ALTER TABLE `reservation` CHANGE `city_tax_travel_reason` `city_tax_travel_reason` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
), the schema-tool works:
user@srv3:~/portal/bin/app$ ./doctrine orm:schema-tool:update --dump-sql
The following SQL statements will be executed:
ALTER TABLE reservation CHANGE city_tax_travel_reason city_tax_travel_reason ENUM('business', 'leisure') NOT NULL COMMENT '(DC2Type:enumtravelreason)';
If I do that, the next call brings back the dreaded invalid type enum-error I try to solve with this class:
user@srv3:~/portal/bin/app$ ./doctrine orm:schema-tool:update --dump-sql --force
The following SQL statements will be executed:
ALTER TABLE reservation CHANGE city_tax_travel_reason city_tax_travel_reason ENUM('business', 'leisure') NOT NULL COMMENT '(DC2Type:enumtravelreason)';
Updating database schema...
1 query was executed
[OK] Database schema updated successfully!
user@srv3:~/portal/bin/app$ ./doctrine orm:schema-tool:update --dump-sql
In AbstractPlatform.php line 434:
Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it.
orm:schema-tool:update [--complete] [--dump-sql] [-f|--force]
user@srv3:~/portal/bin/app$
Am I missing something?