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
Adding multi_server_setup to already established application #208
Comments
We have investigated this issue. The problem appears to be in the We then compared the
The switch happens in the Thus, we believe the error is that
To the PG adapter. This appears to have fixed the problem. Note: We used multi_tenantify(tenant, false) because we want to use the DB name defined in the |
I also want to note that this only appears to be an issue when one is using Apartment with:
|
Steps to reproduce
When I run
Apartment::Tenant.create('tenant_2')
The connection is established to the new Database Host/DB and the schema "spaces" are created forpublic
andtenant_2
, however no tables are created.If I add a new tenant with single database server setup the schema "space" is created and the tables are defined.
Expected behavior
I expect it to create the tables on the new server.
Actual behavior
Executing
Apartment::Tenant.drop('tenant_2')
succeeds in dropping the tenant from the new server.Listing the schemas on each server
Server 1
Server 2 [New]
System configuration
Database: pg 14
Apartment version: 2.11.0
Apartment config (in
config/initializers/apartment.rb
or so):use_schemas
:true
config.with_multi_server_setup = true
Rails (or ActiveRecord) version: 6.1.7
Ruby version: 3.04
The text was updated successfully, but these errors were encountered: