Skip to content

Use enum values from enumType in DiscriminatorColumn and check DiscriminatorMap values against it #11804

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

Open
wants to merge 86 commits into
base: 3.4.x
Choose a base branch
from

Conversation

whataboutpereira
Copy link

Fix for issue #11794.

Currently the values of enumType in DiscriminatorColumn are ignored which results in an error when generating a migration:

Doctrine\DBAL\Platforms\MySQL80Platform requires the values of a ENUM column to be specified.

Fixed by populating values from the enum and also prevent invalid entries in DiscriminatorMap.

@whataboutpereira
Copy link
Author

I'm unsure where to go from here. It seems to me tests are failing on platforms with no native enum support.

@derrabus
Copy link
Member

derrabus commented Jan 25, 2025

I'm unsure where to go from here. It seems to me tests are failing on platforms with no native enum support.

No, the tests are failing on DBAL versions without EnumType.

@derrabus derrabus changed the base branch from 3.3.x to 3.4.x January 25, 2025 12:49
greg0ire and others added 14 commits January 26, 2025 12:01
We should be using quoteSingleIdentifier(), assuming we only ever pass
single identifiers here.

See doctrine/dbal#6590
The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
…exed-relation

11783 failure with indexed relation
Bumps [doctrine/.github](https://github.com/doctrine/.github) from 7.1.0 to 7.2.1.
- [Release notes](https://github.com/doctrine/.github/releases)
- [Commits](doctrine/.github@7.1.0...7.2.1)

---
updated-dependencies:
- dependency-name: doctrine/.github
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…ions/2.20.x/doctrine/dot-github-7.2.1

Bump doctrine/.github from 7.1.0 to 7.2.1
[DDC-551] fix, add filter support in oneToOne relation 2.20.x
…ctor

This fixes a bug that arises when using Pagination and an entity relation is mapped with fetch-mode EAGER but setFetchMode LAZY (or anything that is not EAGER) has been used on the query. If the query use WITH condition, an exception is incorrectly raised (Associations with fetch-mode=EAGER may not be using WITH conditions).
The class LimitSubqueryOutputWalker clones the query, but not its parameters and hints, so the generated subquery does not know that fetch-mode has been overridden.

Fixes doctrine#11741
Clone query hints and parameters in `LimitSubqueryOutputWalker` constructor
Fix DQL example with composite key
greg0ire and others added 30 commits March 27, 2025 20:59
…eats

Add more detailed caveats for using the Collection filtering API
replace Index::overrules() with custom checks
no longer use Table::columnsAreIndexed()
do not use deprecated foreign key constraint features
use the platform to quote table names
[doctrine#6823] pass unquoted identifier folding to AbstractPlatform
* doc: fix setFileExtension() xml mapping documentation

* Update docs/en/reference/xml-mapping.rst

Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>

---------

Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
The old proxy implementation of doctrine/common was triggered by public
methods rather than access to properties (making public properties
unsupported in entities), so tests could use public instance properties
to track the state of postLoad lifecycle callbacks without triggering
the proxy initialization when reading that state (which then changes the
state of triggering the postLoad callback).
As the new proxy implementation hooks into properties instead, the tests
now use a static method (ensuring it is reset properly before loading
the instance for which we care about the tracking) instead of an
instance property.
do not use deprecated primary key constraint features
do not use deprecated index features
disable detecting modified indexes with DBAL 4.3
prefer primary key constraints over Index::isPrimary()
PostLoad listeners might initialize values for transient properties, so
the proxy should not skip initialization when using transient
properties.

Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
Fix the initialization of lazy-ghost proxies with postLoad listeners
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.