diff --git a/UPGRADE.md b/UPGRADE.md index 73f80797549..f2e30f3ed97 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -13,10 +13,11 @@ awareness about deprecated code. The `TableDiff` methods `getModifiedColumns()` and `getRenamedColumns()` have been merged into a single method `getChangedColumns()`. Use this method instead. -## Deprecated support for MariaDB 10.4 and MySQL 5.7 +## Deprecated support for MariaDB 10.4, MySQL 5.7 and Postgres 10 + 11 * Upgrade to MariaDB 10.5 or later. * Upgrade to MySQL 8.0 or later. +* Upgrade to Postgres 12 or later. ## Add `Result::getColumnName()` diff --git a/docs/en/reference/platforms.rst b/docs/en/reference/platforms.rst index ef51fb84ce9..75dae3702f2 100644 --- a/docs/en/reference/platforms.rst +++ b/docs/en/reference/platforms.rst @@ -58,8 +58,7 @@ Microsoft SQL Server PostgreSQL ^^^^^^^^^^ -- ``PostgreSQLPlatform`` for version 9.4 and above. -- ``PostgreSQL100Platform`` for version 10.0 and above. +- ``PostgreSQLPlatform`` for version 10.0 and above. - ``PostgreSQL120Platform`` for version 12.0 and above. IBM DB2 diff --git a/psalm.xml.dist b/psalm.xml.dist index 5d24c78e626..56d83d38e34 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -51,6 +51,7 @@ + diff --git a/src/Driver/AbstractPostgreSQLDriver.php b/src/Driver/AbstractPostgreSQLDriver.php index a7735acc68b..dbeb5055864 100644 --- a/src/Driver/AbstractPostgreSQLDriver.php +++ b/src/Driver/AbstractPostgreSQLDriver.php @@ -11,6 +11,7 @@ use Doctrine\DBAL\Platforms\PostgreSQL120Platform; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\ServerVersionProvider; +use Doctrine\Deprecations\Deprecation; use function preg_match; use function version_compare; @@ -40,6 +41,12 @@ public function getDatabasePlatform(ServerVersionProvider $versionProvider): Pos return new PostgreSQL120Platform(); } + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/6495', + 'Support for Postgres < 12 is deprecated and will be removed in DBAL 5', + ); + return new PostgreSQLPlatform(); } diff --git a/src/Platforms/PostgreSQL120Platform.php b/src/Platforms/PostgreSQL120Platform.php index b68bed34583..3fff90e2490 100644 --- a/src/Platforms/PostgreSQL120Platform.php +++ b/src/Platforms/PostgreSQL120Platform.php @@ -6,6 +6,8 @@ /** * Provides the behavior, features and SQL dialect of the PostgreSQL 12.0 database platform. + * + * @deprecated This class will be removed once support for Postgres < 12 is dropped. */ class PostgreSQL120Platform extends PostgreSQLPlatform { diff --git a/src/Platforms/PostgreSQLPlatform.php b/src/Platforms/PostgreSQLPlatform.php index f409f0aa701..0af29f674a9 100644 --- a/src/Platforms/PostgreSQLPlatform.php +++ b/src/Platforms/PostgreSQLPlatform.php @@ -33,7 +33,8 @@ use function trim; /** - * Provides the behavior, features and SQL dialect of the PostgreSQL 9.4+ database platform. + * Provides the behavior, features and SQL dialect of the PostgreSQL database platform + * of the oldest supported version. */ class PostgreSQLPlatform extends AbstractPlatform { diff --git a/tests/Driver/VersionAwarePlatformDriverTest.php b/tests/Driver/VersionAwarePlatformDriverTest.php index 0959e754ecc..05c9fb19e57 100644 --- a/tests/Driver/VersionAwarePlatformDriverTest.php +++ b/tests/Driver/VersionAwarePlatformDriverTest.php @@ -71,7 +71,8 @@ public static function postgreSQLVersionProvider(): array ['10.0', PostgreSQLPlatform::class], ['11.0', PostgreSQLPlatform::class], ['12.0', PostgreSQL120Platform::class], - ['13.3', PostgreSQL120Platform::class], + ['13.16', PostgreSQL120Platform::class], + ['16.4', PostgreSQL120Platform::class], ]; }