[10.x] BC Fix: Invalid platform: PostgreSQL120Platform after upgrade to doctrine/dbal to 3.9.0 #52706
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a conflict in Laravel 10.x using the
doctrine/dbal >= 3.9
library instead ofdoctrine/dbal >= 4.0
due to anInvalid Platform: PostgreSQL120Platform
error when trying to modify a column in table in PostgreSQL (>= 12) during migration.I know that bug fix support for Laravel 10.x ended on 06.08.2024, but for those who have not yet migrated their projects to Laravel 11.x (like me), this may become a big problem. :)
Details
Laravel 10.48
PostgresSQL >= 12
doctrine/dbal 3.9.0
Added new
Doctrine\DBAL\Platforms\PostgreSQL120Platform
(doctrine/dbal#6199) todoctrine/dbal 3.9.0
to detect PostgreSQL versions >= 12.There is no new platform in
getSQLDeclaration()
insrc/Illuminate/Database/DBAL/TimestampType.php
,Therefore, now when I try to execute the command, the exception
"Invalid platform: PostgreSQL120Platform"
is thrown.The bug report was also previously mentioned in
doctrine/dbal
doctrine/dbal#6506Another Solution
Maybe another fix would be to add
Doctrine\DBAL\Platforms\PostgreSQL120Platform
togetSQLDeclaration()
But additional testing is needed.
Thanks. :)