Skip to content

Commit

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

## BC BREAK: removed `AbstractPlatform` methods.

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

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

Expand Down
1 change: 0 additions & 1 deletion psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
<!--
TODO: remove in 4.0.0
-->
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::getDefaultSchemaName"/>
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::supportsCreateDropDatabase"/>
<referencedMethod name="Doctrine\DBAL\Platforms\DB2Platform::supportsCreateDropDatabase"/>
</errorLevel>
Expand Down
12 changes: 0 additions & 12 deletions src/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2222,18 +2222,6 @@ public function supportsSchemas(): bool
return false;
}

/**
* Returns the default schema name.
*
* @deprecated
*
* @throws Exception If not supported on this platform.
*/
public function getDefaultSchemaName(): string
{
throw NotSupported::new(__METHOD__);
}

/**
* Whether this platform supports create database.
*
Expand Down
16 changes: 0 additions & 16 deletions src/Platforms/PostgreSQLPlatform.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\Types\BinaryType;
use Doctrine\DBAL\Types\BlobType;
use Doctrine\Deprecations\Deprecation;
use UnexpectedValueException;

use function array_diff;
Expand Down Expand Up @@ -125,21 +124,6 @@ public function supportsSchemas(): bool
return true;
}

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

return 'public';
}

public function supportsIdentityColumns(): bool
{
return true;
Expand Down
16 changes: 0 additions & 16 deletions src/Platforms/SQLServerPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Doctrine\DBAL\Schema\Sequence;
use Doctrine\DBAL\Schema\SQLServerSchemaManager;
use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\Deprecations\Deprecation;
use InvalidArgumentException;

use function array_merge;
Expand Down Expand Up @@ -109,21 +108,6 @@ public function supportsSchemas(): bool
return true;
}

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

return 'dbo';
}

public function supportsColumnCollation(): bool
{
return true;
Expand Down
15 changes: 11 additions & 4 deletions tests/Functional/Schema/SchemaManagerFunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
use Doctrine\DBAL\Exception\DatabaseObjectNotFoundException;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Schema\AbstractAsset;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\Column;
Expand Down Expand Up @@ -1055,13 +1057,18 @@ protected function assertVarBinaryColumnIsValid(Table $table, string $columnName

public function testListTableDetailsWithFullQualifiedTableName(): void
{
if (! $this->connection->getDatabasePlatform()->supportsSchemas()) {
$platform = $this->connection->getDatabasePlatform();

if ($platform instanceof PostgreSQLPlatform) {
$defaultSchemaName = 'public';
} elseif ($platform instanceof SQLServerPlatform) {
$defaultSchemaName = 'pdo';
} else {
self::markTestSkipped('Test only works on platforms that support schemas.');
}

$defaultSchemaName = $this->connection->getDatabasePlatform()->getDefaultSchemaName();
$primaryTableName = 'primary_table';
$foreignTableName = 'foreign_table';
$primaryTableName = 'primary_table';
$foreignTableName = 'foreign_table';

$table = new Table($foreignTableName);
$table->addColumn('id', 'integer', ['autoincrement' => true]);
Expand Down

0 comments on commit 6e58532

Please sign in to comment.