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
Database: mysql 5.6
Apartment version: > 2
Apartment config (in config/initializers/apartment.rb or so):
config/initializers/apartment.rb
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
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
Database: mysql 5.6
Apartment version: > 2
Apartment config (in
config/initializers/apartment.rb
or so):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