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

CREATE SCHEMA public is added to all down migrations in Postgres #1415

Open
speller opened this issue Mar 11, 2024 · 2 comments
Open

CREATE SCHEMA public is added to all down migrations in Postgres #1415

speller opened this issue Mar 11, 2024 · 2 comments

Comments

@speller
Copy link

speller commented Mar 11, 2024

Bug Report

Q A
Version 3.8.3

Summary

I'm using the bundle with Postrgres 16. The database URL is postgresql://$DB_USER:$DB_PASSWORD@db:5432/$DB_NAME?serverVersion=16.2&charset=utf8. But on every doctrine:migrations:diff it creates migrations like the following:

final class Version20240311103945 extends AbstractMigration
{
    public function getDescription(): string
    {
        return '';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs

    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('CREATE SCHEMA public');
    }
}

No matter what are other changes, it ALWAYS adds the $this->addSql('CREATE SCHEMA public'); line to all migrations.

How to fix it?

@maluramichael
Copy link

We got the exact same problem. Dont know how to work around it :/

@greg0ire
Copy link
Member

Related to doctrine/dbal#5609 and doctrine/dbal#1110 I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants