DDC-969: SchemaTool fails with class table inheritance if id columnName is not "id" #1210

Open
opened 2026-01-22 13:06:04 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Jan 5, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user ayhan:

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

$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);
Originally created by @doctrinebot on GitHub (Jan 5, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user ayhan: In method **getSchemaFromMetadata()** within the _$class->isInheritanceTypeJoined()_ part the following line ``` $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); ```
admin added the Bug label 2026-01-22 13:06:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1210