Skip to content

postgres schema is redirected when only a pdo connection is given #1705

@kimberv

Description

@kimberv

I use postgres with multiple schemas in one database, and I hand in my pdo connection via phinx config rather than specify dsn settings. Though my pg connection is already properly set to point to the right schema, phinx is resetting schema to public if config.schema is not given (see CakeAdapter line 63).

The easy workaround is to specify schema in the config, but it seems unnecessary. Preferred would be that, if I hand phinx a pdo connection via config, it would trust it and leave it alone. An uneducated suggestion would be to change line 63 to something like:

    if (!isset($config['connection']) && $connection->getDriver() instanceof Postgres) {

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