From e024701ab908fc4991a1ae07d76256218d001643 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 16 Jun 2023 09:20:49 +0200 Subject: [PATCH] Try using getModels() outside of DB::transaction() --- src/Commands/CreateRLSPoliciesForTenantTables.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Commands/CreateRLSPoliciesForTenantTables.php b/src/Commands/CreateRLSPoliciesForTenantTables.php index af41c351..81509a21 100644 --- a/src/Commands/CreateRLSPoliciesForTenantTables.php +++ b/src/Commands/CreateRLSPoliciesForTenantTables.php @@ -19,9 +19,7 @@ class CreateRLSPoliciesForTenantTables extends Command public function handle(): int { - DB::transaction(function () { - tenancy()->getTenantModels()->each(fn (Model $model) => $this->useRlsOnModel($model)); - }); + tenancy()->getModels()->each(fn (Model $model) => $this->useRlsOnModel($model)); return Command::SUCCESS; }