-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix SchemaTool::getSchemaFromMetadata() uniqueConstraint without a predefined name #11314
Merged
derrabus
merged 2 commits into
doctrine:2.18.x
from
rmotaln:fix-schema-tool-unique-constraint-read
Mar 3, 2024
Merged
Fix SchemaTool::getSchemaFromMetadata() uniqueConstraint without a predefined name #11314
derrabus
merged 2 commits into
doctrine:2.18.x
from
rmotaln:fix-schema-tool-unique-constraint-read
Mar 3, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rmotaln
force-pushed
the
fix-schema-tool-unique-constraint-read
branch
from
February 26, 2024 22:23
a01a45e
to
4e8174a
Compare
derrabus
reviewed
Mar 3, 2024
derrabus
force-pushed
the
fix-schema-tool-unique-constraint-read
branch
from
March 3, 2024 14:13
4e8174a
to
f18ac73
Compare
…out a name Fixes a type miss-match exception when reading a UniqueConstraint defined on an Entity which doesn't have a predefined name.
derrabus
force-pushed
the
fix-schema-tool-unique-constraint-read
branch
from
March 3, 2024 14:28
f18ac73
to
706d7b6
Compare
derrabus
approved these changes
Mar 3, 2024
derrabus
added a commit
to derrabus/orm
that referenced
this pull request
Mar 3, 2024
* 2.18.x: Fix annotation Bump CI workflows (doctrine#11336) Fix SchemaTool::getSchemaFromMetadata() uniqueConstraint without a predefined name (doctrine#11314)
derrabus
added a commit
to derrabus/orm
that referenced
this pull request
Mar 3, 2024
* 2.18.x: Fix annotation Bump CI workflows (doctrine#11336) Fix SchemaTool::getSchemaFromMetadata() uniqueConstraint without a predefined name (doctrine#11314)
derrabus
added a commit
to derrabus/orm
that referenced
this pull request
Mar 3, 2024
* 2.18.x: Fix annotation Bump CI workflows (doctrine#11336) Fix SchemaTool::getSchemaFromMetadata() uniqueConstraint without a predefined name (doctrine#11314)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug Report
Summary
SchemaTool can't correctly read a UniqueConstraint when it doesn't have a name specified.
Current behavior
If a unique constraint is specified for a table without a defined name i.e.:
#[ORM\UniqueConstraint(fields: ['field', 'anotherField'])]
, the reading fails due to a type missmatch here. In such a case the$indexName
is an integer but it should be null. This is correctly applied hereHow to reproduce
Add a
#[ORM\UniqueConstraint(fields: ['field', 'anotherField'])]
to any entity and try to dump SQL. You will getExpected behavior
The unique constraint should be loaded correctly and a unique name should be generated for it automatically.