Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doctrine- unknown database type enum requested

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?

like image 979
Mayank Awasthi Avatar asked Feb 06 '14 09:02

Mayank Awasthi


Video Answer


1 Answers

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'
                        ),
                    )
                )
            )
       );
like image 78
Ash Singh Avatar answered Sep 21 '22 02:09

Ash Singh