DBAL-916: Some alter table statements do not respect @Table name value #2157

Closed
doctrinebot opened this Issue May 30, 2014 · 3 comments

3 participants

@doctrinebot

Jira issue originally created by user been_there_done_that:

I have specified the table name for each class generating a table. I find that some table names are respected during doctrine update upon the database, and some are not.

Specifically it seems that simpler entities, one's annotated with entity/table become lower case, while more complicated ones (inheritance map) respect the given table name.

@doctrinebot

Comment created by been_there_done_that:

On further inspection, this does not appear to be a bug with Doctrine. A simple dump of the update statements generated shows no table name change, but:

ALTER TABLE Comment DROP FOREIGN KEY FK_5BC96BF03DBEAF48;
DROP INDEX IDX_5BC96BF03DBEAF48 ON Comment;
ALTER TABLE Comment CHANGE replytoid replytoxid INT DEFAULT NULL;
ALTER TABLE Comment ADD CONSTRAINT FK5BC96BF0484A4D29 FOREIGN KEY (replytoxid) REFERENCES Comment (id);
CREATE INDEX IDX5BC96BF0484A4D29 ON Comment (replytoxid);

Somehow causes mysql to change the case of the table on MacOS.

weird.

@doctrinebot

Comment created by @deeky666:

[~beenthere_donethat] can you please provide more details concerning your actual problem? I'm not sure I understand what the problem is here. I can't see how the SQL you pointed out changes a table's name in any way so I don't understand how that could change the table name's case.
Concerning identifier casing in general I would suggest you to read the following from the MySQL documentation:
http://dev.mysql.com/doc/refman/5.5/en/identifier-case-sensitivity.html

And a pretty good explanation of the problem with identifiers and case accross operating systems and database vendors:
http://www.alberton.info/dbms*identifiers_and_case*sensitivity.html#.U47DV3IZWlM

If the casing of identifiers (table names, column names etc.) in your schema is important for you, you will either have to quote those in your mapping explicitly or use a custom quoting strategy. Please refer to the documentation for further details:
http://docs.doctrine-project.org/en/latest/reference/basic-mapping.html#quoting-reserved-words

Hope that helps.

@doctrinebot doctrinebot added the Bug label Dec 7, 2015
@beberlei beberlei was assigned by doctrinebot Dec 7, 2015
@deeky666 deeky666 assigned deeky666 and unassigned beberlei Jan 10, 2016
@deeky666 deeky666 added the Casing label Jan 10, 2016
@deeky666
Doctrine member

No feedback given, information insufficient for reproduction. Also it potentially sounds like it has something to do with ORM instead of DBAL.

@deeky666 deeky666 closed this Jan 10, 2016
@deeky666 deeky666 added the Tables label Jan 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment