Preserve camelcase when mapping existing database#289
Preserve camelcase when mapping existing database#289isanosian wants to merge 1 commit intodoctrine:masterfrom isanosian:master
Conversation
…base using Symfony's command php app/console doctrine:mapping:convert xml ./src/Acme/BlogBundle/Resources/config/doctrine/metadata/orm --from-database --force
There was a problem hiding this comment.
Fixes camel case for table name
|
Hummm... I took another look on code and found the following: Before my change if I have table name that uses camelcase, I will get camelcase removed (i.e. for MyCamelCaseTable I will get Mycamelcasetable entity); if I have table that uses snake case, I will get camelcased entity (for my_snake_case_table I will get MySnakeCaseTable entity). From one hand, this way chance of confilicts is reduced, from another hand it will rarely happen that one will create both camelcased and snakecased table names. Maybe this behavior should be removed or just configurable. |
|
It should be configurable, and the current behavior should be the default. |
|
@isanosyan Thanks for your fix. It works for me. |
CamelCase is now preserved when importing entities from existing database using Symfony's command
php app/console doctrine:mapping:convert xml ./src/Acme/BlogBundle/Resources/config/doctrine/metadata/orm --from-database --force