-
Notifications
You must be signed in to change notification settings - Fork 168
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
Support configuration for skip checking of schema existence before switching #26
Comments
As part of the migration running, it should be fine to check for the schema existence. Maybe show a warning message informing the user that there are schemas being referenced that do not exist in the database and show a proposed solution: |
rpbaltazar
changed the title
Support configuration for checking if schema exists before switching
Support configuration for skip checking of schema existence before switching
Apr 2, 2020
rpbaltazar
added a commit
that referenced
this issue
May 5, 2020
rpbaltazar
added a commit
that referenced
this issue
May 5, 2020
rpbaltazar
added a commit
that referenced
this issue
May 5, 2020
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Using postgresql, when running Apartment::Tenant.switch, before switching it check for the schema existence. In some cases, when there is a fair amount of load in the database, this can have an impact since it is yet another query being done.
Expected behavior
I think we should support a configuration that allows the apartment users to skip the schema existence and let them handle the errors on their end however they want.
Actual behavior
Currently there is no way to support this unless we monkeypatch the postgresql adapter in order to achieve it.
System configuration
postgresql - 12.0
Apartment version: 2.3.0
Apartment config (in
config/initializers/apartment.rb
or so):use_schemas
:true
Rails (or ActiveRecord) version: 6.0.2.1
Ruby version: 2.6
The text was updated successfully, but these errors were encountered: