Skip to content
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

Tables not to be created in public schema #642

Open
PradeepNP opened this issue Mar 6, 2020 · 1 comment
Open

Tables not to be created in public schema #642

PradeepNP opened this issue Mar 6, 2020 · 1 comment

Comments

@PradeepNP
Copy link

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/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

@PradeepNP
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant