orchestral / tenanti

[Package] Multi-tenant Database Schema Manager for Laravel
MIT License
587 stars 53 forks source link

[Discussion] Creating a tenancy based on table not on domain. #76

Closed parallela closed 3 years ago

parallela commented 3 years ago

Hello. So I'm trying to make something like tenancy but not fully. I have that table structure in my main (system) database:

Offices:
   - id 
   - name
   - description
   - district_uuid (string)

Districts:
    - id
    - uuid (string) (related to `Offices.district_uuid`)
    - display_name
    - database_name (Every district has his own database)

And my other migrations for every database are structured like this:

Tablename:
    - column1
    - column2
    - office_id (related to Main Offices table.)

So i want every model that has office_id to make insert,write,create,delete queries to the correct database based on office->district->database_name. I also has read & write connections. Is that going to make the issue more bigger ?

Please give me any suggestions. Can I use this package or I must to coding this logic myself. :)