Closed bdensmore closed 5 years ago
Per documentation it's stated that it will happen.
Rails will always access the 'public' tenant when accessing these models, but note that tables will be created in all schemas. This may not be ideal, but its done this way because otherwise rails wouldn't be able to properly generate the schema.rb file.
Any ideas how this could be achieved? I feel not good about leaving admin tables within the tenant schemes.
@nhh Did you ever figure out a way?
@tmedford Hey, sorry unfortunately not! We completely switched our hosting model. Not building a saas anymore 🤪 Kind of „managed“ hosting now. Each instance with its own server.
Steps to reproduce
Apartment::Tenant.create(name)
Expected behavior
Expect Excluded models not to be created in tenant schemas. User and Subdomain models are set as excluded but when a new tenant is created it's creating the users and subdomains table in the tenants schema. So they exist in both "public" and "demo" tenants. They should be in "public" only.
Actual behavior
Excluded models are being created in tenant schemas
System configuration
Database: (Tell us what database and its version you use.) Postgresql 10.5-1
Apartment version: 2.2.0
Apartment config (in
config/initializers/apartment.rb
or so):use_schemas
:true