I am using doctrine 2 within zend framework 2. To generate entities using database table, the console command used is:
php doctrine-module orm:convert-mapping --force --from-database annotation ./export
When i run above command, it throws an error:
Unknown database type enum requested
How to solve this issue?
You can add:
'doctrine_type_mappings' => array(
'enum' => 'string'
)
in your global configuration file located in /config/autoload/global.php
.
Example code:
return array(
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'driverClass' =>'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '3306',
'user' => 'username',
'password' => 'password',
'dbname' => 'DevBrew',
),
// To automatically convert enum to string
'doctrine_type_mappings' => array(
'enum' => 'string'
),
)
)
)
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With