2
votes

I'm using Symfony2.0 and add mapping_types in config.yml

doctrine:
        dbal:
            default_connection: default
            connections:
                default:
                    driver:   pdo_mysql
                    host:     localhost
                    dbname:   work_contactbee
                    user:     devuser
                    password: devuser
                    mapping_types:
                        enum: string

But when I try to update schema: php app/console doctrine:schema:update I get an exeption *Unrecognized options "mapping_types" under "doctrine.dbal.connections.default*

Anybody can help with that?

2

2 Answers

3
votes

For anyone still looking. I solved this for my situation by removing the connections and default_connections part.

So:

doctrine:
    dbal:
        driver:   pdo_mysql
        host:     localhost
        dbname:   work_contactbee
        user:     devuser
        password: devuser
        mapping_types:
            enum: string

Either the docs are wrong, or (more likely) I've misinterpreted them. I'm not sure why your example didn't work tbh.

0
votes

Which version of Symfony are you using? From 2.1 the mapping_types are defined as an array of mapping_types so if you are using the latest version (2.2), enum: string is no longer valid. See full list of config options for latest version: http://symfony.com/doc/current/reference/configuration/doctrine.html