Comma Seperated lists, values are not trimmed for unique-constraint columns attribute XML Schema #6090

Open
opened 2026-01-22 15:26:35 +01:00 by admin · 0 comments
Owner

Originally created by @crtl on GitHub (Oct 22, 2018).

Feature Request

Q A
New Feature no
RFC yes
BC Break no

Summary

Ive noticed that white spaces matter in the [columns] definition of <unique-constraint>.
I havent tested it for other lists but given the following example:

<!-- ... -->
<entity name="Vendor\Module\Model\Locale" table="locale">
        <id name="id" column="id" type="bigint" />
        <field name="countryCode" column="country_code" type="string" length="3" />
        <field name="languageCode" column="language_code" type="string" length="3" />

        <unique-constraints>
            <unique-constraint columns="country_code, language_code" name="locale" />
        </unique-constraints>

</entity>
<!-- ... -->

Running vendor/bin/doctrine orm:validate-schema then prints the following error:

  There is no column with name ' language_code' on table 'locale'.

In my opinion it should be possible to add whitespaces in [columns]-attribute for more readability.

Originally created by @crtl on GitHub (Oct 22, 2018). ### Feature Request | Q | A |------------ | ------ | New Feature | no | RFC | yes | BC Break | no #### Summary Ive noticed that white spaces matter in the `[columns]` definition of `<unique-constraint>`. I havent tested it for other lists but given the following example: ```html <!-- ... --> <entity name="Vendor\Module\Model\Locale" table="locale"> <id name="id" column="id" type="bigint" /> <field name="countryCode" column="country_code" type="string" length="3" /> <field name="languageCode" column="language_code" type="string" length="3" /> <unique-constraints> <unique-constraint columns="country_code, language_code" name="locale" /> </unique-constraints> </entity> <!-- ... --> ``` Running `vendor/bin/doctrine orm:validate-schema` then prints the following error: ``` There is no column with name ' language_code' on table 'locale'. ``` In my opinion it should be possible to add whitespaces in `[columns]`-attribute for more readability.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6090