-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add index mapping to column #11988
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
Add index mapping to column #11988
Conversation
c58579f
to
507e0aa
Compare
Please improve your commit message according to the contributing guide. |
This should target 3.5.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add documentation
4479e7c
to
ad21cde
Compare
Added docs, changed test to introspect schema instead, and fixed a PHP8.1 issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tentatively yes, but this needs more work. The test must be moved MappingDriverTestCase
and adapted to all the drivers. The logic of converting the instruction to an index should be moved from AttributeDriver to ClassMetadata::mapField. Each driver only converts to the common array format for $field['index']
Since it's tentatively yes, and we've got 3/4 approvals, should I wait for this PR to be merged and then create a new one? Or do you want me to make changes in this PR? |
Personally, I think you should change this PR. |
25156e4
Done. I opted to remove the If users want to set their own index names, they should use the |
Adds a new option to Column mapping to add indexes to class fields directly instead of having to use the Index() class attribute. This allows users to define indexes in traits where access to the class isn't available. Fixes doctrine#11982
Thanks @jannes-io ! |
Thanks for the quick replies and reviews @greg0ire . Glad we could get this feature added 🙂 |
See #11982