Skip to content

Preserve camelcase when mapping existing database#289

Closed
isanosian wants to merge 1 commit intodoctrine:masterfrom
isanosian:master
Closed

Preserve camelcase when mapping existing database#289
isanosian wants to merge 1 commit intodoctrine:masterfrom
isanosian:master

Conversation

@isanosian
Copy link

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

…base using Symfony's command

php app/console doctrine:mapping:convert xml ./src/Acme/BlogBundle/Resources/config/doctrine/metadata/orm --from-database --force
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes camel case for table name

@isanosian
Copy link
Author

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.

@beberlei
Copy link
Member

It should be configurable, and the current behavior should be the default.

@isanosian isanosian closed this Mar 24, 2012
@ThaDafinser
Copy link

@isanosyan Thanks for your fix. It works for me.

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

Successfully merging this pull request may close these issues.

3 participants