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

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

Open
aliasdoc opened this issue Jul 23, 2017 · 0 comments
Open

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

aliasdoc opened this issue Jul 23, 2017 · 0 comments

Comments

@aliasdoc
Copy link

aliasdoc commented Jul 23, 2017

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.

@aliasdoc aliasdoc changed the title Working with 2 connections Don't switch schema if you check if it exists before Jul 23, 2017
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

1 participant