diff --git a/UPGRADE.md b/UPGRADE.md index 41ff25760e8..782f8c1c1d0 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -8,6 +8,10 @@ awareness about deprecated code. # Upgrade to 4.3 +## The `version` column platform option has been deprecated + +The `version` column platform option has been deprecated without a replacement. + ## The `Doctrine\DBAL\Query\Limit` class has been marked as internal ## Deprecated extension of some classes diff --git a/src/Platforms/AbstractMySQLPlatform.php b/src/Platforms/AbstractMySQLPlatform.php index b80ff8c9957..b4e6fcc6484 100644 --- a/src/Platforms/AbstractMySQLPlatform.php +++ b/src/Platforms/AbstractMySQLPlatform.php @@ -173,6 +173,12 @@ public function getClobTypeDeclarationSQL(array $column): string public function getDateTimeTypeDeclarationSQL(array $column): string { if (isset($column['version']) && $column['version'] === true) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/6940', + 'The "version" column platform option is deprecated.', + ); + return 'TIMESTAMP'; } diff --git a/src/Platforms/DB2Platform.php b/src/Platforms/DB2Platform.php index 50931f0abd0..3e347e07b8a 100644 --- a/src/Platforms/DB2Platform.php +++ b/src/Platforms/DB2Platform.php @@ -174,6 +174,12 @@ public function getDateDiffExpression(string $date1, string $date2): string public function getDateTimeTypeDeclarationSQL(array $column): string { if (isset($column['version']) && $column['version'] === true) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/6940', + 'The "version" column platform option is deprecated.', + ); + return 'TIMESTAMP(0) WITH DEFAULT'; } @@ -473,6 +479,12 @@ public function getDefaultValueDeclarationSQL(array $column): string } if (isset($column['version']) && $column['version'] === true) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/6940', + 'The "version" column platform option is deprecated.', + ); + if ($column['type'] instanceof DateTimeType) { $column['default'] = '1'; }