Doctrine superclass inheritance - indexes are not inherited #5186

Open
opened 2026-01-22 15:00:57 +01:00 by admin · 0 comments
Owner

Originally created by @nacholibre on GitHub (Jul 10, 2016).

Originally assigned to: @Ocramius on GitHub.

/**
 * @MappedSuperclass
 * @Table(indexes={@Index(name="idx", columns={"name"})})
 */
class BaseSuperClass
{
    /** @Column(type="string") */
    protected $name;

    // ... more fields and methods
}

/** @Entity */
class EntitySubClass extends BaseSuperClass
{
    /** @Id @Column(type="integer") */
    private $id;

    // ... more fields and methods
}

Name index is not inherited from BaseSuperClass, it there any way to achieve this?

Originally created by @nacholibre on GitHub (Jul 10, 2016). Originally assigned to: @Ocramius on GitHub. ``` /** * @MappedSuperclass * @Table(indexes={@Index(name="idx", columns={"name"})}) */ class BaseSuperClass { /** @Column(type="string") */ protected $name; // ... more fields and methods } /** @Entity */ class EntitySubClass extends BaseSuperClass { /** @Id @Column(type="integer") */ private $id; // ... more fields and methods } ``` Name index is not inherited from `BaseSuperClass`, it there any way to achieve this?
admin added the Invalid label 2026-01-22 15:00:57 +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#5186