Skip to content

Single table inheritance and indexes #5543

Open
@ghost

Description

Hi,

I have an entity that uses single table inheritance so we are able to extend it within different projects...

However whenever I define new / additional indexes in the extended entity they are getting ignored?

Here is the code for my two entities.

Thanks,

Harry

Base:

/**
 * @ORM\Entity
 * @InheritanceType("SINGLE_TABLE")
 *
 * @ORM\HasLifecycleCallbacks
 * @ORM\Table(name="property_data", indexes={
 *      @ORM\Index(name="listing_status", columns={"listing_status"}),
 *      @ORM\Index(name="reference", columns={"reference"}),
 *      @ORM\Index(name="listing_type", columns={"listing_type"}),
 *      @ORM\Index(name="status", columns={"status"}),
 *      @ORM\Index(name="council_id", columns={"council_id"}),
 *      @ORM\Index(name="county_id", columns={"county_id"}),
 *      @ORM\Index(name="town_id", columns={"town_id"}),
 *      @ORM\Index(name="region_id", columns={"region_id"}),
 *      @ORM\Index(name="postcode_id", columns={"postcode_id"}),
 *      @ORM\Index(name="property_type_id", columns={"property_type_id"}),
 *      @ORM\Index(name="num_living_rooms", columns={"num_living_rooms"}),
 *      @ORM\Index(name="num_bathrooms", columns={"num_bathrooms"}),
 *      @ORM\Index(name="num_bedrooms", columns={"num_bedrooms"})
 * })
 */

Extended:

/**
 * Property
 *
 * @ORM\Entity(repositoryClass="Howsmart\Bundle\PropertyBundle\Entity\PropertyRepository")
 * @ORM\Table(name="property_data", indexes={
 *      @ORM\Index(name="listing_status", columns={"listing_status"}),
 *      @ORM\Index(name="reference", columns={"reference"}),
 *      @ORM\Index(name="listing_type", columns={"listing_type"}),
 *      @ORM\Index(name="status", columns={"status"}),
 *      @ORM\Index(name="council_id", columns={"council_id"}),
 *      @ORM\Index(name="county_id", columns={"county_id"}),
 *      @ORM\Index(name="town_id", columns={"town_id"}),
 *      @ORM\Index(name="region_id", columns={"region_id"}),
 *      @ORM\Index(name="postcode_id", columns={"postcode_id"}),
 *      @ORM\Index(name="property_type_id", columns={"property_type_id"}),
 *      @ORM\Index(name="num_living_rooms", columns={"num_living_rooms"}),
 *      @ORM\Index(name="num_bathrooms", columns={"num_bathrooms"}),
 *      @ORM\Index(name="num_bedrooms", columns={"num_bedrooms"}),
 *      @ORM\Index(name="investment_score", columns={"investment_score"}),
 *      @ORM\Index(name="investment_score_accuracy", columns={"investment_score_accuracy"}),
 *      @ORM\Index(name="score_land_property", columns={"score_land_property"}),
 *      @ORM\Index(name="score_transport_infrastructure", columns={"score_transport_infrastructure"}),
 *      @ORM\Index(name="score_education_employement", columns={"score_education_employement"}),
 *      @ORM\Index(name="score_safety_comfort", columns={"score_safety_comfort"}),
 *      @ORM\Index(name="score_lifestyle_leisure", columns={"score_lifestyle_leisure"}),
 *      @ORM\Index(name="agent_id", columns={"agent_id"})
 * })
 */

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions