While working on ACARateQuote.com I came across an issue using symfony2’s doctrine schema update command from the terminal.
Here’s the command
php app/console doctrine:schema:update --force -vv
Here’s the error:
Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it.
The issue is that Doctrine inspects all the tables in the database, even if those tables are not currently mapped to any entities, and that Doctrine does not natively support MySQL’s ENUM column type. In my case, I had a table created with raw data that had not been fully normalized and contained several ENUM columns.
The quickest solution to this problem, is to update your app/config/config.yml to map the ENUM column type to a string column type. The highlighted lines below show the change.
# Doctrine Configuration
# if using pdo_sqlite as your database driver, add the path in parameters.yml
# e.g. database_path: %kernel.root_dir%/data/data.db3
# path: %database_path%
Once you make the update to your config.yml you should be able to execute the console command again without any issues.