Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/Platforms/AbstractMySQLPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down
12 changes: 12 additions & 0 deletions src/Platforms/DB2Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@
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';
}

Expand Down Expand Up @@ -473,6 +479,12 @@
}

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.',
);

Check warning on line 486 in src/Platforms/DB2Platform.php

View check run for this annotation

Codecov / codecov/patch

src/Platforms/DB2Platform.php#L482-L486

Added lines #L482 - L486 were not covered by tests

if ($column['type'] instanceof DateTimeType) {
$column['default'] = '1';
}
Expand Down