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

[5.8] Pass down the serverVersion database connection option to Doctrine DBAL connection #28964

Merged
merged 1 commit into from
Jun 27, 2019
Merged

[5.8] Pass down the serverVersion database connection option to Doctrine DBAL connection #28964

merged 1 commit into from
Jun 27, 2019

Conversation

tonysm
Copy link
Contributor

@tonysm tonysm commented Jun 26, 2019

I got into this issue while I was trying to run the migrations against Azure's MySQL
database. Azure's setup uses a gateway to proxy connections to the correct server,
which tricks PDO, because the gateway version is different than the actual server
that the migration runs. The server runs 5.7, while the gateway server runs a 5.6.

By using this option, we can manually pass the server version (5.7) and the correct
data types will be mapped. In my case, JSON columns were throwing an exception, even
though they are supported in the actual server.

…AL connection

I got into this issue when I was trying to run the migrations against Azure's MySQL
database. Azure's setup uses a gateway [1] to proxy connections to the correct server,
which tricks PDO, because the gateway version is different than the actual server
that the migration runs is 5.7, while the gateway server runs a 5.6.

By using this option, we can manually pass the server version (5.7) and the correct
data types will be mapped. In my case, JSON columns were throwing exception, even
though they are supported in the actual server [2].

References:

[1](https://docs.microsoft.com/en-us/azure/mysql/concepts-supported-versions)
[2](https://www.doctrine-project.org/projects/doctrine-dbal/en/2.9/reference/configuration.html#automatic-platform-version-detection)
@tonysm tonysm changed the title Pass down the serverVersion database connection option to Doctrine DBAL connection [5.8] Pass down the serverVersion database connection option to Doctrine DBAL connection Jun 26, 2019
@tonysm
Copy link
Contributor Author

tonysm commented Jun 26, 2019

Would love to get this on Laravel 5.7.x as well, how can I make it? Should I send another PR to 5.7?

@taylorotwell taylorotwell merged commit 8de4eb9 into laravel:5.8 Jun 27, 2019
@driesvints
Copy link
Member

@tonysm 5.7 isn't supported anymore unfortunately: https://laravel.com/docs/5.8/releases#support-policy

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

Successfully merging this pull request may close these issues.

3 participants