"Unknown database type enum requested ..."

Permalink 1 user found helpful
I have added custom tables using enum as datatype. When I clear the cache this leads to the following error message:
"Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it."

According to Doctrine the solution is to do something like this:
$plattform->registerDoctrineTypeMapping('enum', 'string');


In Concrete5 5.7 this can either be achieved by adding the type in 'initializeDoctrineTypeMappings' in
'concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php'
which is kind of ugly

I ended up adding the following to 'application/bootstrap/app.php'
Database::getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');

View Replies:
SecretsduPuits replied on at Permalink Reply
SecretsduPuits
Hi,

As I was experiencing the same problem, I followed your solution and... it works !!!! :-)

I added the script right on line 2
<?php
Database::getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');

Many thanks,

JF