mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 10:14:04 +00:00
Try using getModels() outside of DB::transaction()
This commit is contained in:
parent
1fb90129cf
commit
e024701ab9
1 changed files with 1 additions and 3 deletions
|
|
@ -19,9 +19,7 @@ class CreateRLSPoliciesForTenantTables extends Command
|
||||||
|
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
DB::transaction(function () {
|
tenancy()->getModels()->each(fn (Model $model) => $this->useRlsOnModel($model));
|
||||||
tenancy()->getTenantModels()->each(fn (Model $model) => $this->useRlsOnModel($model));
|
|
||||||
});
|
|
||||||
|
|
||||||
return Command::SUCCESS;
|
return Command::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue