Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-285

Schema generation fails when primary key is quoted

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.6, 2.2-BETA1, 2.2-BETA2, 2.2-RC1/RC2, 2.2.0-RC3, 2.2, 2.2.1, 2.2.2
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None
    • Environment:
      Linux (gentoo), PHP 5.3.13, MySQL 5.1.62, Symfony2

      Description

      All of our entities are generated with their name quoted with back-ticks, this is to allow RAD.
      When Doctrine comes to update the schema it fails to see the primary key is quoted and thus compared an index of PRIMARY(id) to PRIMARY(`id`). Which means it then tries to drop the primary index and recreate it, using a quoted field name.

      This fix is to when the primary index is created is to fetch the columns from the table and get their unquoted name, so now when the comparison takes place it looks like this PRIMARY(id) to PRIMARY(id), therefore doesn't register this as a change.

        Activity

        Marc Easen created issue -
        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.2.3 [ 10210 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 13722 ] jira-feedback2 [ 17838 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17838 ] jira-feedback3 [ 20193 ]
        Guilherme Blanco made changes -
        Fix Version/s 2.2.3 [ 10210 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DBAL-285, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Marc Easen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: