Each tenant's databases hosted by it's own server #458
Unanswered
robingiraud
asked this question in
Q&A
Replies: 1 comment 5 replies
-
I had this requirement as well. Just extend their task and write / copy what you need yourself. You'll be done in a few seconds. If you need help, let me know. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
By default, this package's multi-tenant system assumes that all databases are hosted on the same server, as there is only the "database" field that is filled in the tenants table.
I need to be able to define a different server for each tenant, which would each host its own database.
So I started by modifying the migration that creates the tenants table, adding some extra fields: "host", "username" and "password".
I guess the next step is to create my own task that implements "SwitchTenantTask" interface, to define my custom way to set the current tenant's database connection, considering, in addition to the database name, the hostname, username and password to access the specific database. But I find it a bit tricky, as I need to override all the default logic provided by the package.
Is there a simpliest way to get there ? Or perhaps one of you had a similar need
In fact, to make it simple, I would like to take into account the host, username and password in the connection configuration of the current tenant (in addition to the database name)
Thanks a lot for any answer ! :)
Beta Was this translation helpful? Give feedback.
All reactions