Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-969

SchemaTool fails with class table inheritance if id columnName is not "id"

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1, 2.1
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      In method getSchemaFromMetadata() within the $class->isInheritanceTypeJoined() part the following line

      Doctrine\ORM\Tools\SchemaTool::getSchemaFromMetadata() — Line 182
      $table->getColumn($class->identifier[0])->setAutoincrement(false);
      

      leads to a Doctrine\DBAL\Schema\SchemaException::columnDoesNotExist() if a columnName other then id is used for the id field, as not the columnName (but the field name) is passed to $table->getColumn().

      Should rather be

      $table->getColumn($columnName)->setAutoincrement(false);
      

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            ayhan
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: