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

Try using getModels() outside of DB::transaction()

This commit is contained in:
lukinovec 2023-06-16 09:20:49 +02:00
parent 1fb90129cf
commit e024701ab9

View file

@ -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;
}