Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove AbstractMySQLPlatform::getColumnTypeSQLSnippets() #6214

Merged
merged 12 commits into from
Nov 13, 2023
5 changes: 5 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ awareness about deprecated code.

# Upgrade to 4.0

## BC BREAK: removed `AbstractMySQLPlatform` methods.

1. `getColumnTypeSQLSnippets()`,
2. `getDatabaseNameSQL()`.

## BC BREAK: Removed lock-related `AbstractPlatform` methods

The methods `AbstractPlatform::getReadLockSQL()`, `::getWriteLockSQL()` and `::getForUpdateSQL()` have been removed
Expand Down
23 changes: 0 additions & 23 deletions src/Platforms/AbstractMySQLPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
use Doctrine\DBAL\SQL\Builder\SelectSQLBuilder;
use Doctrine\DBAL\TransactionIsolationLevel;
use Doctrine\DBAL\Types\Types;
use Doctrine\Deprecations\Deprecation;

use function array_merge;
use function array_unique;
use function array_values;
use function count;
use function func_get_args;
use function implode;
use function in_array;
use function is_numeric;
Expand Down Expand Up @@ -219,27 +217,6 @@ public function supportsColumnCollation(): bool
return true;
}

/**
* @deprecated Use {@see getColumnTypeSQLSnippet()} instead.
*
* The SQL snippets required to elucidate a column type
*
* Returns an array of the form [column type SELECT snippet, additional JOIN statement snippet]
*
* @return array{string, string}
*/
public function getColumnTypeSQLSnippets(string $tableAlias = 'c'): array
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/6202',
'AbstractMySQLPlatform::getColumnTypeSQLSnippets() is deprecated. '
. 'Use AbstractMySQLPlatform::getColumnTypeSQLSnippet() instead.',
);

return [$this->getColumnTypeSQLSnippet(...func_get_args()), ''];
}

/**
* The SQL snippet required to elucidate a column type
*
Expand Down
4 changes: 1 addition & 3 deletions src/Schema/MySQLSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,7 @@ protected function selectTableNames(string $databaseName): Result

protected function selectTableColumns(string $databaseName, ?string $tableName = null): Result
{
// @todo 4.0 - call getColumnTypeSQLSnippet() instead
[$columnTypeSQL, $joinCheckConstraintSQL] = $this->platform->getColumnTypeSQLSnippets('c', $databaseName);
$columnTypeSQL = $this->platform->getColumnTypeSQLSnippet('c', $databaseName);

$sql = 'SELECT';

Expand All @@ -365,7 +364,6 @@ protected function selectTableColumns(string $databaseName, ?string $tableName =
FROM information_schema.COLUMNS c
INNER JOIN information_schema.TABLES t
ON t.TABLE_NAME = c.TABLE_NAME
$joinCheckConstraintSQL
SQL;

// The schema name is passed multiple times as a literal in the WHERE clause instead of using a JOIN condition
Expand Down