Open jimishjoban opened 5 years ago
Do you have public schema as a part of persistent_schemas
option? I had the same problem when both public and user schemas were containing table with the same name. The solution for me was to manually create schema and run migration since persistent_schemas
option is not threadsafe.
An alternative solution is to use config.use_sql = true
in apartment.rb
config file as it seems the DROP commands are caused by the algorithm that uses the schema.rb
.
Steps to reproduce
Apartment::Tenant.create('archived')
Expected behavior
It should simply create a new schema with tables present in public.
Actual behavior
Its dropping all data/tables in public schema... Disaster!
System configuration
Ruby - ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux] Usinng PG Bouncer to connect. (if it matters)
Postgres 9.3
2.1.0
config/initializers/apartment.rb
or so):Same ditto config as gennerated...
4.1.5
Ruby - ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]