Skip to content

Don't switch schema if you check if it exists before #1

@aliasdoc

Description

@aliasdoc

Hi, I have an application which use two connections:

  • MySQL for local needs (connection "mysql")
  • PostgreSQL for getting remote data (connection "psql_tunnel")

I use your package to work with my psql_tunnel connection, when I switch schema it work but if I make a check before it doesn't.

if (PGSchema::schemaExists('xxxx'.$tenant, env('xxxx', 'pgsql_tunnel'))) {
    PGSchema::schema('xxxx'.$tenant, env('xxxx', 'pgsql_tunnel'));
} else {
    dd('schema does not exists');
}

if I switch without check, it works:
PGSchema::schema('xxxx'.$tenant, env('xxxx', 'pgsql_tunnel'));

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions