-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
PermissionAlreadyExists with multitenancy #1071
Comments
Hmmm ... first thing coming to mind is whether the db:seed call is properly connecting to the right database. I know this package is agnostic about which db connection it's using ... as in, it just uses the primary/default connection. So maybe that's not actually "agnostic", but rather highly opinionated as in "unconfigurable". :) You might need to override the models and set your own $connection property in them, as hinted at in the comments on this old non-merged PR: #719 Aside: Unfortunately I'm going to be AFK for the rest of the week and unable to look at related code until then. But maybe the above gives you something to explore in the meantime. I'd like to see what you discover. |
turned out it was a caching issue. The package works with only 1 cache, which initialises before the middleware initialises where the multitenancy switching is found. current FIX: |
Thanks for posting back with the details of the cause, and a solution! |
When connecting to a new and clean tenant, and try to seed it, it will give a PermissionAlreadyExists error. however the specific tenant it uses is empty. there is literally no data in it. In the seeders i try to forget all caches etc. Could there be something else I am doing wrong?
Console
Migration
Context command
PS: I LOVE YOUR PACKAGES!!!!
The text was updated successfully, but these errors were encountered: