symfony-docs icon indicating copy to clipboard operation
symfony-docs copied to clipboard

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

Open nicwortel opened this issue 1 year ago • 1 comments

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 https://github.com/doctrine/dbal/pull/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:[email protected]:3306/db_name?serverVersion=5.7"

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

For example:

  • https://symfony.com/doc/current/doctrine.html#configuring-the-database
  • https://symfony.com/doc/current/doctrine/dbal.html
  • https://symfony.com/doc/current/reference/configuration/doctrine.html#doctrine-dbal-configuration

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:

  • https://github.com/symfony/symfony-docs/issues/19138
  • https://github.com/symfony/symfony-docs/issues/18297

nicwortel avatar May 09 '24 15:05 nicwortel

Thank you for the explanation.

PR is welcome to avoid deprecation or exception for newcomers

alamirault avatar May 09 '24 18:05 alamirault