From 89d9e20c38c427708828bf161bac90524ab947c1 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 16 Jun 2023 10:47:35 +0200 Subject: [PATCH] Dump dropped policies --- src/Commands/CreateRLSPoliciesForTenantTables.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Commands/CreateRLSPoliciesForTenantTables.php b/src/Commands/CreateRLSPoliciesForTenantTables.php index 3c64dad4..534a2df8 100644 --- a/src/Commands/CreateRLSPoliciesForTenantTables.php +++ b/src/Commands/CreateRLSPoliciesForTenantTables.php @@ -34,7 +34,8 @@ class CreateRLSPoliciesForTenantTables extends Command $table = $model->getTable(); $tenantKey = tenancy()->tenantKeyColumn(); - // DB::statement("DROP POLICY IF EXISTS {$table}_rls_policy ON {$table}"); + dump($model::class, 'dropping policy of ' . $table); + DB::statement("DROP POLICY IF EXISTS {$table}_rls_policy ON {$table}"); if (tenancy()->modelBelongsToTenant($model)) { DB::statement("CREATE POLICY {$table}_rls_policy ON {$table} USING ({$tenantKey}::TEXT = current_user);");