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
[Doctrine] Replace serverVersion example values with full version numbers #19877
base: 5.4
Are you sure you want to change the base?
Conversation
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 symfony#19876.
@@ -53,7 +53,7 @@ The database connection information is stored as an environment variable called | |||
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/app.db" | |||
|
|||
# to use postgresql: | |||
# DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8" | |||
# DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=12.19 (Debian 12.19-1.pgdg120+1)&charset=utf8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the correct format according to Doctrine DBAL, but I'm not sure if the DATABASE_URL
can contain spaces and parentheses...
Can someone confirm that this works? Otherwise I will set up a test installation of Symfony with PostgreSQL and test it myself...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for mariadb its mariadb-10.11.5
i dont know for postgresql, but perhaps there is sort of same convention naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That actually changed as well with DBAL 4.0, see UPGRADE.md:
BC BREAK: Removed mariadb- prefix hack
Previously, it was necessary to prefix the serverVersion parameter with mariadb- when using MariaDB. Doing so is now considered invalid, and you should prefer using the version as returned by SELECT VERSION();
-'serverVersion' => 'mariadb-10.9.3' +'serverVersion' => '10.9.3-MariaDB-1'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasnt aware of this, still using v3
but thx for sharing :)
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.