mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DBAL deprecation: AbstractPlatform::usesSequenceEmulatedIdentityColumns is deprecated
#7162
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dmaicher on GitHub (Jun 2, 2023).
I noticed the following deprecation report on my projects:
This is caused by
b52a8f8b9e/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php (L622)Is there a way to avoid this deprecation inside
ClassMetadataFactory?@greg0ire commented on GitHub (Jun 2, 2023):
Cc @ruudk
@greg0ire commented on GitHub (Jun 2, 2023):
The only way I can think of is making the behavior configurable. Either we continue checking, or we don't based on some boolean defined in the ORM config.
@stof commented on GitHub (Jun 2, 2023):
This check is necessary to avoid breaking BC in the ORM (see that when this method returns
true, we reach a deprecated path).What we need is to find a way to detect the cases non-deprecated case in a non-deprecated way, to avoid reporting a deprecation in that case.
@greg0ire commented on GitHub (Jun 2, 2023):
Do you mean reimplementing this with
instanceofchecks? That does not sound too great 🤔 It would be cool if we could ignore that deprecation, but just once (or rather as many times as going on that codepath). But I don't thinkdoctrine/deprecationsallows that. Right now, only end users are supposed to callDeprecation::ignore*I think.@itinance commented on GitHub (Nov 29, 2023):
For what I found in the official documentation, the recommended way of generating Primary Keys with auto-generated values in PostgreSQL is
See: https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_serial
So no SERIAL, no SEQUENCEs, instead IDENTITY.
The strategy IDENTITY is neither providing this syntax nor usable thanks to deprecated-messages.
Is there anything available that we don't need to patch Migration-Files manually?
@stof commented on GitHub (Nov 29, 2023):
What we would need for PostgreSQL is updating the PostgreSQLPlatform to use the new way of creating identity columns for PostgreSQL 10+
@greg0ire commented on GitHub (Nov 29, 2023):
@itinance I'm afraid you'll be stuck until
doctrine/dbal4 is available.@dmaicher commented on GitHub (Jan 10, 2025):
Closing this as it seems not relevant anymore with DBAL 4