mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 19:24:02 +00:00
Delete dump, use getTenantModels
This commit is contained in:
parent
89d9e20c38
commit
1fd1aa7ad6
1 changed files with 1 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ class CreateRLSPoliciesForTenantTables extends Command
|
|||
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;
|
||||
|
|
@ -34,7 +34,6 @@ class CreateRLSPoliciesForTenantTables extends Command
|
|||
$table = $model->getTable();
|
||||
$tenantKey = tenancy()->tenantKeyColumn();
|
||||
|
||||
dump($model::class, 'dropping policy of ' . $table);
|
||||
DB::statement("DROP POLICY IF EXISTS {$table}_rls_policy ON {$table}");
|
||||
|
||||
if (tenancy()->modelBelongsToTenant($model)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue