How to create a unique lowercase index? #5258

Closed
opened 2026-01-22 15:02:48 +01:00 by admin · 4 comments
Owner

Originally created by @atkrad on GitHub (Sep 16, 2016).

Originally assigned to: @Ocramius on GitHub.

Hi,
How to create a unique lowercase index in schema?

Originally created by @atkrad on GitHub (Sep 16, 2016). Originally assigned to: @Ocramius on GitHub. Hi, How to create a unique lowercase index in schema?
admin added the Can't Fix label 2026-01-22 15:02:48 +01:00
admin closed this issue 2026-01-22 15:02:49 +01:00
Author
Owner

@Ocramius commented on GitHub (Sep 16, 2016):

Use the @UniqueConstraint mapping (or equivalent, depending on mapping format)

@Ocramius commented on GitHub (Sep 16, 2016): Use the `@UniqueConstraint` mapping (or equivalent, depending on mapping format)
Author
Owner

@atkrad commented on GitHub (Sep 16, 2016):

@Ocramius I know, But I want create index based on lower case for example:
CREATE UNIQUE INDEX lower_case_username ON users ((lower(username)));

@atkrad commented on GitHub (Sep 16, 2016): @Ocramius I know, But I want create index based on lower case for example: `CREATE UNIQUE INDEX lower_case_username ON users ((lower(username)));`
Author
Owner

@Ocramius commented on GitHub (Sep 16, 2016):

That's not supported, since it's a DB-specific feature (indexes on functions applied to columns): use a DB migration.

@Ocramius commented on GitHub (Sep 16, 2016): That's not supported, since it's a DB-specific feature (indexes on functions applied to columns): use a DB migration.
Author
Owner

@atkrad commented on GitHub (Sep 16, 2016):

@Ocramius Thank you.

@atkrad commented on GitHub (Sep 16, 2016): @Ocramius Thank you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5258