1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 19:24:02 +00:00

Purge central connection in RLS bootstrapper's bootstrap()

This commit is contained in:
lukinovec 2023-06-15 11:06:57 +02:00
parent f859a5da06
commit e8b3c23c72

View file

@ -33,6 +33,8 @@ class PostgresRLSBootstrapper implements TenancyBootstrapper
public function bootstrap(Tenant $tenant): void
{
$this->database->purge($this->config->get('tenancy.database.central_connection'));
/** @var TenantWithDatabase $tenant */
$this->config->set('database.connections.pgsql.username', $tenant->database()->getUsername() ?? $tenant->getTenantKey());
$this->config->set('database.connections.pgsql.password', $tenant->database()->getPassword() ?? 'password');