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

Delete dump, put getModels into transaction

This commit is contained in:
lukinovec 2023-06-16 10:26:15 +02:00
parent bd7f885c23
commit 46b89fd0ec

View file

@ -19,7 +19,9 @@ class CreateRLSPoliciesForTenantTables extends Command
public function handle(): int public function handle(): int
{ {
tenancy()->getModels()->each(fn (Model $model) => $this->useRlsOnModel($model)); DB::transaction(function () {
tenancy()->getModels()->each(fn (Model $model) => $this->useRlsOnModel($model));
});
return Command::SUCCESS; return Command::SUCCESS;
} }
@ -57,7 +59,6 @@ class CreateRLSPoliciesForTenantTables extends Command
)) ))
) )
)"); )");
dump(DB::select('SELECT * FROM pg_policies'));
$this->enableRls($table); $this->enableRls($table);