Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2563

orm:schema-tool:update generates ALTER TABLE tablename without backquoting tablename with

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Invalid
    • Affects Version/s: 2.3.4
    • Fix Version/s: None
    • Component/s: Mapping Drivers
    • Security Level: All
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Marco Pivetta added a comment -

        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

        Show
        Marco Pivetta added a comment - 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

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Pavel Smirnov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: