-
Notifications
You must be signed in to change notification settings - Fork 460
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
Allow a list of schemas when switching using schemas #568
Open
ryanbrunner
wants to merge
315
commits into
influitive:development
Choose a base branch
from
AbleHealth:feature/multiple_schemas
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Allow a list of schemas when switching using schemas #568
ryanbrunner
wants to merge
315
commits into
influitive:development
from
AbleHealth:feature/multiple_schemas
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ryanbrunner
force-pushed
the
feature/multiple_schemas
branch
4 times, most recently
from
October 5, 2018 19:07
65ec5c1
to
99cb83e
Compare
V2.4.0 Release
Fix gemspec open versions and updated version
Support rails 6.1
Update readme example for `active_record_log`
Prepare Release - 2.8.1 **Implemented enhancements:** **Fixed bugs:** - New version raises an error with ActiveSupport::LogSubscriber [influitive#128](rails-on-services/apartment#128) - Weird logs when tenant fails to create [influitive#127](<rails-on-services/apartment#127>) **Closed issues:** - Removed travis and slim configured circleci [influitive#130](rails-on-services/apartment#130)
Prepare Release - 2.9.0 **Implemented enhancements:** - Add config for handling tenant creation on db:migrate - influitive#140 **Fixed bugs:** **Closed issues:** - Tenant exists errors on migrate task on 2.8.0 [influitive#136](rails-on-services/apartment#136) - Add Rails 6.1 to build matrix influitive#144
marksiemers
force-pushed
the
feature/multiple_schemas
branch
from
April 13, 2021 17:40
390bede
to
19770a1
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the ability to switch to a list of tenants rather than a single tenant.
The reason you may want to do this is to support a partial schema. If you create a schema that contains some of the tables present in a customer schema, you can use Apartment to prefer the partial schema when retrieving or modifying data, but falling back to the "main" customer schema when a table isn't present.
For example, if Schema A contained the following tables:
and Schema B contained the following tables:
then calls to
Foo
andBar
would access Schema A, while calls toBaz
would access Schema B:We use this to create a "context" where some tables can be updated while other tables continue to utilize the main tables. This can simulate the effect of a transaction by allowing a table to be populated in a staging schema prior to it being committed to the main schema.