Posts Tagged ‘MySQL’

FIXED: Doctrine 2 Unknown database type enum requested

Unknown database type enum requested

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:


[Doctrine\DBAL\DBALException]
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.

Once you make the update to your config.yml you should be able to execute the console command again without any issues.