JosephSilber/bouncer

Migration issues using Multitenancy System

undjike opened this issue ยท 8 comments

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?

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?

@undjike have you resolved this issue?

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

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

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

I was using the same...

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

I think it's from >=8.