-
Notifications
You must be signed in to change notification settings - Fork 460
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
rails 6.1.alpha support #638
Comments
How are you able to use it with Rails 6? I installed the gem but then the application crashed and I can't even run the apartment generator |
@cristianrosu this repo is no more maintained. You need to use this one now. Use Ps: If you're working on a new project, you may think twice before use this gem, it may not be the best solution, if you have a lot of tenants, as the creators themselves explain here. I use it with Postgresql schemas and few tenants, it's working great. |
@jean-francois-labbe I was not aware of that fork, thanks a lot, looks promising! I won't have many tenants but it's important to separate data per account. It will work good for now. Thanks! |
Above link is dead, working link is here: https://medium.com/infinite-monkeys/our-multi-tenancy-journey-with-postgres-schemas-and-apartment-6ecda151a21f |
Steps to reproduce
I'm trying to use apartment with rails 6.1.alpha (rails-master) tests are failing and I don't understand the issue yet.
The error is:
When I try to debug the application the only difference I see between rails-6.0 and rails-master
is during migrations
With Rails-6.0 it executes:
with Rails-6.1.alpha (master) it executes:
That would justify the error, but I don't understand why it doesn't create the schema_migrations database
use_schemas
:true
During tests 2 dbs are created, the first one is perfectly created, but the second one is missing the tables
schema_migrations
andar_internal_metadata
.After some debugging here is what I found.
This is the sql log of the first database creation. It is here just to ease comparison between the two dbs creation.
Second db is where troubles are.
create_table
is defined in schema_migration.rbtable_exists?
implementation is in model_schema.rbIn rails 6.0 schema_migration.rb had a method table_exists? defined in it, the implementation was:
It was removed in this commit rails/rails@c5ecc33#diff-a15c218db8b9dd9f84a75d9a3894db56
The text was updated successfully, but these errors were encountered: