Skip to content

Postgres - Generate migration only for public schema #549

@orangevinz

Description

@orangevinz

I'm using PostgreSQL v16 with extensions such as jobmon and partman.
Each time I run make:migration, it generates a new migration with extensions diffs.

With this configuration

doctrine:
    dbal:
        default_connection:       default
        connections:
            default:
                url: '%env(resolve:DATABASE_URL)%'
                use_savepoints: true
                profiling_collect_backtrace: '%kernel.debug%'
                schema_filter: '~^(?!doctrine_migration_versions$|.*jobmon.*|.*partman.*|.*dblink.*)~'

The generated down method includes:

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

How can I restrict migrations to the public schema only ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions