You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a class has InheritanceType attribute and it extend another class that has at least a property, it generate an error duplicate definication of column the properties in the extended class for orm v3.1.1 and v3.1.0, but worked for v2.7.5.
In MappingException.php line 420:
Duplicate definition of column 'id' on entity 'Entity\CategoryLink' in a field or discriminator column mapping.
How to reproduce
The MappedSuperclass
namespace MappedSuperClass;
use \Doctrine\ORM\Mapping as ORM;
#[ORM\MappedSuperclass]
abstract class AbstractEntity {
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $id = null;
}
The class with InheritanceType attribute
namespace Entity;
use \Doctrine\ORM\Mapping as ORM;
use \MappedSuperClass\AbstractEntity;
/**
* @property mixed $Linked
*/
#[ORM\Entity]
#[ORM\Table(name: 'stock_tree')]
#[ORM\InheritanceType('JOINED')]
#[ORM\DiscriminatorColumn(name: 'discriminator', type: 'string')]
#[ORM\DiscriminatorMap([
'Category' => \Entity\CategoryLink::class
])]
class StockTreeEntity extends AbstractEntity {
}
An inheritor class
namespace Entity;
use \Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'categories_link')]
class CategoryLink extends StockTreeEntity {
}
Run doctrine orm:schema-tool:update --dump-sql, generate the error
In MappingException.php line 420:
Duplicate definition of column 'id' on entity 'Entity\CategoryLink' in a field or discriminator column mapping.
The text was updated successfully, but these errors were encountered:
BC Break Report
Summary
If a class has InheritanceType attribute and it extend another class that has at least a property, it generate an error duplicate definication of column the properties in the extended class for orm v3.1.1 and v3.1.0, but worked for v2.7.5.
How to reproduce
The MappedSuperclass
The class with InheritanceType attribute
An inheritor class
Run
doctrine orm:schema-tool:update --dump-sql
, generate the errorThe text was updated successfully, but these errors were encountered: