Skip to content

Loading…

DDC-2563: orm:schema-tool:update generates ALTER TABLE tablename without backquoting tablename with #3291

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user iterra:

I have an entity "Index"
Running doctrine orm:schema-tool:update using CLI generates following

ALTER TABLE Index ADD Merchant_Id BIGINT DEFAULT NULL

Note there are no backquotes around Index, should be like this:

ALTER TABLE Index ADD Merchant_Id BIGINT DEFAULT NULL

Naturally SQL fails due to the use of mysql token word as a table name.
Manual workarounds exist, but all DDL should really use proper quotes.

@doctrinebot

Comment created by @ocramius:

The ORM comes with quoting strategies to be used when you don't use ANSI compliant identifier names. Alternatively, wrap the entity table name with mysql-style identifier delimiter ticks ("`") in your mappings

@doctrinebot

Issue was closed with resolution "Invalid"

@Ocramius Ocramius was assigned by doctrinebot
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.