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

Rework introspection of table names #5452

Merged
merged 2 commits into from
Jun 19, 2022
Merged

Conversation

morozov
Copy link
Member

@morozov morozov commented Jun 19, 2022

The AbstractPlatform::getListTablesSQL() method deprecated in #5268 cannot be removed yet because it's used by AbstractSchemaManager::listTableNames(). Following the same principle as earlier, this patch moves the logic of building schema introspection queries from the platform classes to the schema managers making the queries an internal implementation detail rather than a public API.

@@ -255,7 +263,7 @@ protected function _getPortableTableForeignKeyDefinition($tableForeignKey)
*/
protected function _getPortableTableDefinition($table)
{
if (isset($table['schema_name']) && $table['schema_name'] !== 'dbo') {
if ($table['schema_name'] !== 'dbo') {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isset() check is redundant since the columns should always be in the result set. Suppressing the notice if it doesn't exist creates a potential for regressions during the refactoring of the schema introspection queries.

$sql = <<<'SQL'
SELECT name,
SCHEMA_NAME(schema_id) AS schema_name
FROM sys.objects
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're moving from sysobjects in SQLServerPlatform to sys.objects here since the former is deprecated.

@morozov morozov added this to the 3.4.0 milestone Jun 19, 2022
@morozov morozov marked this pull request as ready for review June 19, 2022 18:34
@morozov morozov merged commit feca492 into doctrine:3.4.x Jun 19, 2022
@morozov morozov deleted the list-table-names branch June 19, 2022 21:12
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants