Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow partial index length on MySQL Primary Keys #4405

Open
gggeek opened this issue Nov 3, 2020 · 0 comments
Open

Allow partial index length on MySQL Primary Keys #4405

gggeek opened this issue Nov 3, 2020 · 0 comments

Comments

@gggeek
Copy link

gggeek commented Nov 3, 2020

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

DBAL does support specification of a length for column indexes when using MySQL databases.
A common usage of this is when a varchar column longer than 191 character needs to have an index defined - depending on the mysql server version in use and its configuration parameters this might be allowed or not. When not allowed, a possible workaround is to define the index on a portion (prefix) of the whole column.
At the moment DBAL support for this is limited to the definition of extra indexes (including Unique indexes), but it excludes the definition of a Primary Key.
Given the fact that defining a PK with an index length is supported by MySQL, and that the same apparent violation of logical constraints applies to unique indexes as well, I think that it makes sense to add DBAL support to PKs with a specified length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants