Skip to content

Commit

Permalink
Merge pull request #5072 from morozov/deprecate-mysql-5.6
Browse files Browse the repository at this point in the history
Deprecate support for MySQL 5.6 and older
  • Loading branch information
morozov committed Dec 2, 2021
2 parents e4df1a5 + 10d9abf commit 932c596
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ following methods are deprecated:
The protected property `AbstractPlatform::$doctrineTypeComments` is deprecated
as well.

## Deprecated support for MySQL 5.6 and older

MySQL 5.6 and older won't be actively supported in DBAL 4. Consider upgrading to MySQL 5.7 or later.
The following classes have been deprecated:

* `Doctrine\DBAL\Platforms\MySQL57Platform`
* `Doctrine\DBAL\Platforms\Keywords\MySQL57Keywords`

## Deprecated support for Postgres 9

Postgres 9 won't be actively supported in DBAL 4. Consider upgrading to Postgres 10 or later.
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@
<!--
TODO: remove in 4.0.0
-->
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\MySQL57Keywords"/>
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords"/>
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\PostgreSQL94Keywords"/>
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords"/>
<referencedClass name="Doctrine\DBAL\Platforms\MySQL57Platform"/>
<referencedClass name="Doctrine\DBAL\Platforms\PostgreSQL100Platform"/>
<referencedClass name="Doctrine\DBAL\Platforms\PostgreSQL94Platform"/>
<referencedClass name="Doctrine\DBAL\Platforms\SQLServer2012Platform"/>
Expand Down
8 changes: 8 additions & 0 deletions src/Driver/AbstractMySQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\MySQLSchemaManager;
use Doctrine\DBAL\VersionAwarePlatformDriver;
use Doctrine\Deprecations\Deprecation;

use function assert;
use function preg_match;
Expand Down Expand Up @@ -47,6 +48,13 @@ public function createDatabasePlatformForVersion($version)
}
}

Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/5060',
'MySQL 5.6 support is deprecated and will be removed in DBAL 4.'
. ' Consider upgrading to MySQL 5.7 or later.'
);

return $this->getDatabasePlatform();
}

Expand Down
2 changes: 2 additions & 0 deletions src/Platforms/Keywords/MySQL57Keywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/**
* MySQL 5.7 reserved keywords list.
*
* @deprecated Use {@link MySQLKeywords} instead.
*/
class MySQL57Keywords extends MySQLKeywords
{
Expand Down
3 changes: 3 additions & 0 deletions src/Platforms/MySQL57Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

/**
* Provides the behavior, features and SQL dialect of the MySQL 5.7 (5.7.9 GA) database platform.
*
* @deprecated This class will be merged with {@see MySQLPlatform} in 4.0 because support for MySQL
* releases prior to 5.7 will be dropped.
*/
class MySQL57Platform extends MySQLPlatform
{
Expand Down

0 comments on commit 932c596

Please sign in to comment.