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

Add support to the new id entity generation preferences in Doctrine ORM 3.0 #1744

Open
TeLiXj opened this issue Jan 22, 2024 · 1 comment
Open

Comments

@TeLiXj
Copy link

TeLiXj commented Jan 22, 2024

In the lastest ORM beta version, a new setting is used to configure the default value for the #[ORM\GeneratedValue] attribute if has no values https://github.com/doctrine/orm/releases/tag/3.0.0-beta1

This appears in a deprecation notice in the lastest versions of Symfony and I only found a workaround using a compiler pass #1740 (comment) but I think that should be configured directly in the bundle

@BigBenJr
Copy link

Indeed I encounter this depreciation message:

User Deprecated: 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 "Doctrine\DBAL\Platforms\PostgreSqlPlatform", so you should use $configuration->setIdentityGenerationPreferences([ "Doctrine\DBAL\Platforms\PostgreSqlPlatform" => ClassMetadata::GENERATOR_TYPE_SEQUENCE, ]); (ClassMetadataFactory.php:755 called by ClassMetadataFactory.php:629, doctrine/orm#8893, package doctrine/orm)

What is the best fix at the moment ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants