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

Migration issues using Multitenancy System #641

Open
undjike opened this issue Sep 16, 2023 · 8 comments
Open

Migration issues using Multitenancy System #641

undjike opened this issue Sep 16, 2023 · 8 comments

Comments

@undjike
Copy link

undjike commented Sep 16, 2023

Hello Team,

First of all, thanks for the brillant job you achieved. It's really well implemented and time saving.

Nevertheless, I'm facing issues using the package in a multitenancy system where there is a permission management in each tenant database and also in the landlord database (means 02 levels of permission management implemented via 02 database connections).

First, I'm forced to use class name in the migration file generated by the package. When I convert it to anonymous class syntax, I get errors running migrations.

Second, I have a dedicated folder for tenant migrations and landlord migrations located the usual place. When running migrations (forced to use class name syntax), I get an error too.

image

So, my questions are:

  1. Why not make use of anonymous class syntax for the package migration?
  2. Is it possible to specify the connection used by the Bouncer facade?
@robinlecouteur
Copy link

I'm just cruising through, but have you tried naming the migration to TenantCreateBouncerTables or something? Also what is the exact error you get when using anonymous class?

@digitlimit
Copy link

@undjike have you resolved this issue?

@undjike
Copy link
Author

undjike commented Nov 4, 2023

I haven't. Do you face the same issue?

@digitlimit
Copy link

digitlimit commented Nov 4, 2023

@undjike Yes, building tenancy application with https://github.com/archtechx/tenancy

@undjike
Copy link
Author

undjike commented Nov 4, 2023

@undjike yes, building tenancy application with https://github.com/archtechx/tenancy

I was using the same...

@digitlimit
Copy link

@undjike I am wondering if I can fix and submit a PR for this.
I believe anonymous migration classes work in Laravel 7 >=

@undjike
Copy link
Author

undjike commented Nov 4, 2023

I think it's from >=8.

@undjike
Copy link
Author

undjike commented Nov 4, 2023

https://laravel-news.com/laravel-anonymous-migrations

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

3 participants