mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
How to create a unique lowercase index? #5258
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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?
@Ocramius commented on GitHub (Sep 16, 2016):
Use the
@UniqueConstraintmapping (or equivalent, depending on mapping format)@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)));@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.
@atkrad commented on GitHub (Sep 16, 2016):
@Ocramius Thank you.