Commit 8de4eb9
committed
Pass down the serverVersion database connection option to Doctrine DBAL 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)1 parent 7b2ba16 commit 8de4eb9
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
900 | | - | |
| 900 | + | |
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
904 | | - | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
905 | 909 | | |
906 | 910 | | |
907 | 911 | | |
| |||
0 commit comments