From 9adbeca0be28c1d0fdbfec7859d85fb71d27f021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ausw=C3=B6ger?= Date: Mon, 13 Nov 2023 16:59:22 +0100 Subject: [PATCH] Remove AbstractMySQLPlatform::getColumnTypeSQLSnippets() (#6214) | Q | A |------------- | ----------- | Type | feature | Fixed issues | https://github.com/doctrine/dbal/pull/6202#discussion_r1382622523 #### Summary Removes `AbstractMySQLPlatform::getColumnTypeSQLSnippets()` Needs to be rebased after #6202 and #6213 got merged upstream. --- UPGRADE.md | 5 +++++ src/Platforms/AbstractMySQLPlatform.php | 23 ----------------------- src/Schema/MySQLSchemaManager.php | 4 +--- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index decf8f4fa85..aab139519f2 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -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 diff --git a/src/Platforms/AbstractMySQLPlatform.php b/src/Platforms/AbstractMySQLPlatform.php index 475f6266f86..770d86341ef 100644 --- a/src/Platforms/AbstractMySQLPlatform.php +++ b/src/Platforms/AbstractMySQLPlatform.php @@ -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; @@ -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 * diff --git a/src/Schema/MySQLSchemaManager.php b/src/Schema/MySQLSchemaManager.php index 29aedac6a89..fa042d653ce 100644 --- a/src/Schema/MySQLSchemaManager.php +++ b/src/Schema/MySQLSchemaManager.php @@ -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'; @@ -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