From e8b3c23c72c48067b03cd96af5318d1e01b72e2b Mon Sep 17 00:00:00 2001 From: lukinovec Date: Thu, 15 Jun 2023 11:06:57 +0200 Subject: [PATCH] Purge central connection in RLS bootstrapper's `bootstrap()` --- src/Bootstrappers/Integrations/PostgresRLSBootstrapper.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Bootstrappers/Integrations/PostgresRLSBootstrapper.php b/src/Bootstrappers/Integrations/PostgresRLSBootstrapper.php index 7fa4fed9..6f66b1d4 100644 --- a/src/Bootstrappers/Integrations/PostgresRLSBootstrapper.php +++ b/src/Bootstrappers/Integrations/PostgresRLSBootstrapper.php @@ -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');