Skip to content

Commit

Permalink
Remove AbstractMySQLPlatform::getColumnTypeSQLSnippets() (doctrine#6214)
Browse files Browse the repository at this point in the history
|      Q       |   A
|------------- | -----------
| Type         | feature
| Fixed issues |
doctrine#6202 (comment)

#### Summary

Removes `AbstractMySQLPlatform::getColumnTypeSQLSnippets()`

Needs to be rebased after doctrine#6202 and doctrine#6213 got merged upstream.
  • Loading branch information
ausi committed Nov 13, 2023
1 parent 44635a2 commit 9adbeca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
5 changes: 5 additions & 0 deletions UPGRADE.md
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
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
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

0 comments on commit 9adbeca

Please sign in to comment.