[PR #8523] Add possibility to use fields instead of column for unique constraint and indexes (#8345) #11040

Open
opened 2026-01-22 16:09:31 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/8523

State: closed
Merged: No


This PR implements feature requested in #8345. It handles all existing drivers (probably upcoming Annotation will need a little change if it gets merged).

I based my work on last comment by @beberlei - it translates fields and columns to indexes only in SchemaTool::getSchemaFromMetadata. I haven't found the need to translate them beforehand, but maybe I've missed something.

I have adapted metadata tests to cover all cases when reading entities and added simple test for translating fields to columns.

In my implementation one can use both fields and columns at the same time and they will be merged.

**Original Pull Request:** https://github.com/doctrine/orm/pull/8523 **State:** closed **Merged:** No --- This PR implements feature requested in #8345. It handles all existing drivers (probably upcoming Annotation will need a little change if it gets merged). I based my work on last comment by @beberlei - it translates fields and columns to indexes only in `SchemaTool::getSchemaFromMetadata`. I haven't found the need to translate them beforehand, but maybe I've missed something. I have adapted metadata tests to cover all cases when reading entities and added simple test for translating fields to columns. In my implementation one can use both `fields` and `columns` at the same time and they will be merged.
admin added the pull-request label 2026-01-22 16:09:31 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#11040