Skip to content
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

Drop support for DBAL 3 #11216

Draft
wants to merge 1 commit into
base: 4.0.x
Choose a base branch
from
Draft

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Feb 4, 2024

This PR removes all compatibility code for DBAL 3. I'm flagging it as a draft for now because I believe that we can backport a few things.

@derrabus derrabus added this to the 4.0.0 milestone Feb 4, 2024
@derrabus derrabus force-pushed the drop/dbal-3 branch 3 times, most recently from e43754c to c376858 Compare February 7, 2024 14:44
@derrabus derrabus force-pushed the drop/dbal-3 branch 3 times, most recently from 5aa8a32 to ebc7951 Compare February 22, 2024 13:00
@greg0ire
Copy link
Member

There is code here that could be simplified I think:

// DBAL 3
if (method_exists($platform, 'getIdentitySequenceName')) {
$nonIdentityDefaultStrategy[Platforms\PostgreSQLPlatform::class] = ClassMetadata::GENERATOR_TYPE_SEQUENCE;
}
foreach ($nonIdentityDefaultStrategy as $platformFamily => $strategy) {
if (is_a($platform, $platformFamily)) {
if ($platform instanceof Platforms\PostgreSQLPlatform) {
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/issues/8893',
<<<'DEPRECATION'
Relying on non-optimal defaults for ID generation is deprecated, and IDENTITY
results in SERIAL, which is not recommended.
Instead, configure identifier generation strategies explicitly through
configuration.
We currently recommend "SEQUENCE" for "%s", when using DBAL 3,
and "IDENTITY" when using DBAL 4,
so you should use probably use the following configuration before upgrading to DBAL 4,
and remove it after deploying that upgrade:
$configuration->setIdentityGenerationPreferences([
"%s" => ClassMetadata::GENERATOR_TYPE_SEQUENCE,
]);
DEPRECATION,
$platformFamily,
$platformFamily,
);
}
return $strategy;
}
}

@derrabus derrabus force-pushed the drop/dbal-3 branch 4 times, most recently from b5a1140 to 5d9b1c6 Compare March 1, 2024 10:15
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.

None yet

2 participants