Allow a list of schemas when switching using schemas#568
Open
ryanbrunner wants to merge 315 commits intoinfluitive:developmentfrom
Open
Allow a list of schemas when switching using schemas#568ryanbrunner wants to merge 315 commits intoinfluitive:developmentfrom
ryanbrunner wants to merge 315 commits intoinfluitive:developmentfrom
Conversation
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
390bede to
19770a1
Compare
This file contains hidden or 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
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
FooandBarwould access Schema A, while calls toBazwould 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.