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

Schema's getMigrateFromSql always adds CREATE SCHEMA public [Still not fixed] #6243

Open
Arkemlar opened this issue Dec 20, 2023 · 1 comment

Comments

@Arkemlar
Copy link

Bug Report

With PostgreSQL

Q A
Version 3.6.4

Summary

All the generated down() methods start with a "CREATE SCHEMA public" line.

⚠️ This bug exists since 2015 (!!!). Previous topic is #1110 which is closed for no reason (no fix has been done).

Current behaviour

console doctrine:migration:diff generates:

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20231220030603 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');
    }
}

How to reproduce

Just use PostgreSQL with public schema (I suppose it is sufficient).
I have this:
изображение

Expected behaviour

It should not add "CREATE SCHEMA public" line.

@greg0ire
Copy link
Member

Hey @Arkemlar , the "How to reproduce" section is supposed to be filled with code allowing to reproduce the issue without any extra software (such as doctrine/migrations or doctrine/orm). Can you maybe write a DBAL test that exhibits the issue?

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

2 participants