mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 06:04:03 +00:00
Filter migration files in create RLS policies command
This commit is contained in:
parent
2fc14837ab
commit
0bf464b80d
1 changed files with 5 additions and 1 deletions
|
|
@ -28,11 +28,15 @@ class CreateRLSPoliciesForTenantTables extends Command
|
|||
|
||||
protected function getTenantTables(): array
|
||||
{
|
||||
$files = array_filter(File::files('./database/migrations/tenant'), function (SplFileInfo $migration) {
|
||||
return str($migration)->contains('create_');
|
||||
});
|
||||
|
||||
return array_map(function (SplFileInfo $migration) {
|
||||
return str($migration->getFilename())
|
||||
->after('create_')
|
||||
->before('_table')
|
||||
->toString();
|
||||
}, File::files('./database/migrations/tenant'));
|
||||
}, $files);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue