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

[DoctrineBundle] Use a full version number in examples with serverVersion #19876

Closed
nicwortel opened this issue May 9, 2024 · 1 comment · Fixed by #19877
Closed

[DoctrineBundle] Use a full version number in examples with serverVersion #19876

nicwortel opened this issue May 9, 2024 · 1 comment · Fixed by #19877
Labels
Doctrine hasPR A Pull Request has already been submitted for this issue.

Comments

@nicwortel
Copy link
Contributor

Doctrine DBAL 3.6.0 deprecated incomplete version numbers for the serverVersion value (for example 8 or 8.0 for MySQL):

afbeelding

While the deprecation warnings are no longer there in DBAL 4, the DBAL documentation (updated in doctrine/dbal#5971) states that serverVersion should contain a full version number:

Please specify the full server version as the database server would report it. This is especially important for MySQL and MariaDB where the full version string is taken into account when determining the platform.

This is also supported by the UPGRADE.md:

The serverVersion connection parameter must consist of 3 numbers:

-'serverVersion' => '8.0'
+'serverVersion' => '8.0.31'

However, most of the Symfony documentation I found still contains examples which configure the DATABASE_URL like this:

DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"

...which seems to conflict with the Doctrine DBAL documentation.

For example:

Should we update these examples to contain a full version number? It seems like the more recent Flex recipes for DoctrineBundle are already using full version numbers, compared to the older recipes.
I'm happy to send a PR, but I wanted to discuss this in an issue before submitting a PR.

This could be related to the following issues / PRs:

@alamirault
Copy link
Contributor

Thank you for the explanation.

PR is welcome to avoid deprecation or exception for newcomers

@xabbuh xabbuh added Doctrine hasPR A Pull Request has already been submitted for this issue. labels May 13, 2024
javiereguiluz added a commit that referenced this issue Jun 10, 2024
…l version numbers (nicwortel)

This PR was merged into the 5.4 branch.

Discussion
----------

[Doctrine] Replace serverVersion example values with full version numbers

Doctrine DBAL 3.6.0 deprecated incomplete version numbers for the serverVersion value (for example 8 or 8.0 for MySQL). Instead, a full version number (8.0.37) is expected.
See https://www.doctrine-project.org/projects/doctrine-dbal/en/4.0/reference/configuration.html#automatic-platform-version-detection and https://github.com/doctrine/dbal/blob/4.0.x/UPGRADE.md#bc-break-disallowed-partial-version-numbers-in-serverversion.

This commit replaces partial version numbers with full version numbers. It also replaces examples with EOL database versions (such as MySQL 5.7 and PostgreSQL 11) with more modern, supported versions.

Fixes #19876.

<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/releases for the list of maintained branches).

If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `7.x` for features of unreleased versions).

-->

Commits
-------

f3ac20e Replace serverVersion example values with full version numbers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Doctrine hasPR A Pull Request has already been submitted for this issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants