influitive / apartment

Database multi-tenancy for Rack (and Rails) applications
2.68k stars 460 forks source link

Tables not to be created in public schema #642

Open PradeepNP opened 4 years ago

PradeepNP commented 4 years ago

Steps to reproduce

Run the command rails db:migrate

I want to create the table in all the tenants' schema except public schema Below is the configuration, is done in the apartment.rb config file

Expected behavior

rake db:migrate, supposed to create tables in only in tenants' schema. But it is also creating table in public schema.

Actual behavior

Not to create any tables in its public schema through rake db:migrate/rails db:migrate

System configuration

config.excluded_models = %w{ Tenant } config.tenant_names = lambda do Tenant.all.each_with_object({}) do |tenant, hash| hash[tenant.database] = tenant.db_configuration end end



  * `use_schemas`: (`true` or `false`)
commented, by default true as it is stated

* Rails (or ActiveRecord) version:
6.0.2

* Ruby version:
2.6
PradeepNP commented 3 years ago

Still I have the same issue, any update on this?