Skip to content

Simple annotation for single-column index #6249

Open
@richard-ejem

Description

@richard-ejem

I'd welcome a simple way to add index to a single column, some shorthand for this:

/**
 * @ORM\Entity
 * @ORM\Table(indexes={@Index(name="foo_idx", columns={"foo"})})
 */
class Foo
{
    /** @ORM\Column(type="string") */
    private $foo;
}

to be annotated directly with the column:

/** @ORM\Entity */
class Foo {
    /** @ORM\Column(type="string", index=true) */
    private $foo;
}

or in a similar way (like @Orm\Index for column). This is possible for unique indexes as Column(unique=true), so I think there should be similar annotation for non-unique indexes.

Any comments welcomed, I can eventually pull-request it if it makes sense for others too.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions