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

Fix doctrine:database:create and doctrine:database:drop for Postgresql on DBAL 4.x #1761

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

ostrolucky
Copy link
Member

@ostrolucky ostrolucky added the Bug label Feb 20, 2024
@ostrolucky ostrolucky added this to the 2.11.4 milestone Feb 20, 2024
@ostrolucky ostrolucky requested a review from greg0ire February 20, 2024 22:01
@@ -64,6 +65,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
/** @psalm-suppress InvalidArrayOffset Need to be compatible with DBAL < 4, which still has `$params['url']` */
unset($params['dbname'], $params['path'], $params['url']);

if ($connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$params['dbname'] = 'postgres';
}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we unset dbname on line 66, only to set it again here? Also, I don't understand the comment on line 64, should it read "as we have already extracted" instead of "and we have already extracted"?

Copy link
Member Author

Choose a reason for hiding this comment

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

For the first point, it's because I assume unsetting dbname might still be needed for other db platforms. For the second point: I guess so.

@ostrolucky ostrolucky merged commit 7150c1d into 2.11.x Feb 20, 2024
11 checks passed
@stof stof deleted the fix-1757 branch August 5, 2024 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create and drop PostgreSQL database fails
2 participants