Skip to content

Commit

Permalink
Remove usesSequenceEmulatedIdentityColumns()
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Jul 16, 2022
1 parent 0a1be75 commit f82df77
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 72 deletions.
3 changes: 2 additions & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ awareness about deprecated code.

## BC BREAK: removed `AbstractPlatform` methods.

1. `getIdentitySequenceName()`.
1. `getIdentitySequenceName()`,
2. `usesSequenceEmulatedIdentityColumns()`.

## BC BREAK: removed support for the `NULL` value of schema asset filter.

Expand Down
3 changes: 0 additions & 3 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@
-->
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::getDefaultSchemaName"/>
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::supportsCreateDropDatabase"/>
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::usesSequenceEmulatedIdentityColumns"/>
<referencedMethod name="Doctrine\DBAL\Platforms\DB2Platform::supportsCreateDropDatabase"/>
<referencedMethod name="Doctrine\DBAL\Platforms\OraclePlatform::usesSequenceEmulatedIdentityColumns"/>
<referencedMethod name="Doctrine\DBAL\Platforms\PostgreSQLPlatform::usesSequenceEmulatedIdentityColumns"/>
</errorLevel>
</DeprecatedMethod>
<DocblockTypeContradiction>
Expand Down
22 changes: 0 additions & 22 deletions src/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
use Doctrine\DBAL\Types;
use Doctrine\DBAL\Types\Exception\TypeNotFound;
use Doctrine\DBAL\Types\Type;
use Doctrine\Deprecations\Deprecation;
use InvalidArgumentException;
use UnexpectedValueException;

Expand Down Expand Up @@ -2183,27 +2182,6 @@ public function supportsIdentityColumns(): bool
return false;
}

/**
* Whether the platform emulates identity columns through sequences.
*
* Some platforms that do not support identity columns natively
* but support sequences can emulate identity columns by using
* sequences.
*
* @deprecated
*/
public function usesSequenceEmulatedIdentityColumns(): bool
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/5513',
'%s is deprecated.',
__METHOD__
);

return false;
}

/**
* Whether the platform supports partial indexes.
*/
Expand Down
16 changes: 0 additions & 16 deletions src/Platforms/OraclePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\TransactionIsolationLevel;
use Doctrine\DBAL\Types\BinaryType;
use Doctrine\Deprecations\Deprecation;
use InvalidArgumentException;

use function array_merge;
Expand Down Expand Up @@ -708,21 +707,6 @@ protected function getRenameIndexSQL(string $oldIndexName, Index $index, string
return ['ALTER INDEX ' . $oldIndexName . ' RENAME TO ' . $index->getQuotedName($this)];
}

/**
* @deprecated
*/
public function usesSequenceEmulatedIdentityColumns(): bool
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/5513',
'%s is deprecated.',
__METHOD__
);

return true;
}

protected function getIdentitySequenceName(string $tableName): string
{
$table = new Identifier($tableName);
Expand Down
15 changes: 0 additions & 15 deletions src/Platforms/PostgreSQLPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,6 @@ public function supportsPartialIndexes(): bool
return true;
}

/**
* @deprecated
*/
public function usesSequenceEmulatedIdentityColumns(): bool
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/5513',
'%s is deprecated.',
__METHOD__
);

return true;
}

public function supportsCommentOnStatement(): bool
{
return true;
Expand Down
5 changes: 0 additions & 5 deletions tests/Platforms/AbstractPlatformTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -692,11 +692,6 @@ public function testAlterTableChangeQuotedColumn(): void
);
}

public function testUsesSequenceEmulatedIdentityColumns(): void
{
self::assertFalse($this->platform->usesSequenceEmulatedIdentityColumns());
}

public function testGetFixedLengthStringTypeDeclarationSQLNoLength(): void
{
self::assertSame(
Expand Down
5 changes: 0 additions & 5 deletions tests/Platforms/OraclePlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,6 @@ public function testDoesNotPropagateUnnecessaryTableAlterationOnBinaryType(): vo
);
}

public function testUsesSequenceEmulatedIdentityColumns(): void
{
self::assertTrue($this->platform->usesSequenceEmulatedIdentityColumns());
}

/**
* @dataProvider dataCreateSequenceWithCache
*/
Expand Down
5 changes: 0 additions & 5 deletions tests/Platforms/PostgreSQLPlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,6 @@ public function testDroppingConstraintsBeforeColumns(): void
self::assertEquals($expectedSql, $sql);
}

public function testUsesSequenceEmulatedIdentityColumns(): void
{
self::assertTrue($this->platform->usesSequenceEmulatedIdentityColumns());
}

/**
* @dataProvider dataCreateSequenceWithCache
*/
Expand Down

0 comments on commit f82df77

Please sign in to comment.