Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapping_types configuration option make doctrine:database:create throw an error #327

Closed
lexwolfy opened this issue Sep 4, 2014 · 6 comments

Comments

@lexwolfy
Copy link

lexwolfy commented Sep 4, 2014

Hi,

I'm currently trying to use enum in my symfony project with this solution :

doctrine:
    /* config */
    mapping_types:
        enum: string

But after adding this option to my config.xml, doctrine:database:create command doesn't work anymore, throwing me this error :

[Doctrine\DBAL\Exception\ConnectionException]                                     
An exception occured in driver: SQLSTATE[42000] [1049] Unknown database 'databasename'

After few researches, I figured out that adding mapping_types cause doctrine to check for databasePlatform and databasePlatformVersion by connecting to database using the databasename in connection param but the database is not created yet.. so error.

Did I miss something in my config ? Even so, I think this error shouldn't be.

Thanks,

@bassim
Copy link

bassim commented Feb 12, 2015

@lexwolfy, did you manage to get a work-around for this?

@lexwolfy
Copy link
Author

I do not use doctrine:database:create anymore, but a mysql command line instead... and then doctrine:schema:update

@dvc
Copy link

dvc commented Feb 13, 2015

@lexwolfy , @bassim, try this:

parameters:

workaround to avoid DB init failure (#351 (comment))

database_server_version: 5.5

@deeky666
Copy link
Member

The parameter is called server_version

@dvc
Copy link

dvc commented Feb 13, 2015

exactly! :)

parameters:
  database_server_version: 5.5

doctrine:
  dbal:
    connections:
        default:
            server_version: %database_server_version%

@kimhemsoe
Copy link
Member

Setting the version_version fixes the issue. This is an issue from dbal and not much we can do about it here. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants