Doctrine- unknown database type enum requested

doctrine-orm, zend-framework2

Solution

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'
                        ),
                    )
                )
            )
       );

Problem

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?

Original source