mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 17:44:05 +00:00
Fix RLS tree generation (specify schema name in generateTrees())
This commit is contained in:
parent
4790a3e999
commit
0f8eb2ec6a
1 changed files with 4 additions and 1 deletions
|
|
@ -75,7 +75,10 @@ class TableRLSManager implements RLSPolicyManager
|
|||
$builder = $this->database->getSchemaBuilder();
|
||||
|
||||
// We loop through each table in the database
|
||||
foreach ($builder->getTableListing() as $table) {
|
||||
foreach ($builder->getTableListing(schema: $this->database->getConfig('search_path')) as $table) {
|
||||
// E.g. "public.table_name" -> "table_name"
|
||||
$table = str($table)->afterLast('.')->toString();
|
||||
|
||||
// For each table, we get a list of all foreign key columns
|
||||
$foreignKeys = collect($builder->getForeignKeys($table))->map(function ($foreign) use ($table) {
|
||||
return $this->formatForeignKey($foreign, $table);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue