Skip to content

Commit 9ca5327

Browse files
committed
Merge branch 'master' into 3.2-merge
2 parents fc396b7 + 461c062 commit 9ca5327

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Schema/PostgresBuilder.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function dropAllTypes()
148148
public function getAllTables(): array
149149
{
150150
return $this->connection->select(
151-
$this->grammar->compileGetAllTables((array) $this->connection->getConfig('schema'))
151+
$this->grammar->compileGetAllTables($this->getSchemas())
152152
);
153153
}
154154

@@ -158,7 +158,7 @@ public function getAllTables(): array
158158
public function getAllViews(): array
159159
{
160160
return $this->connection->select(
161-
$this->grammar->compileGetAllViews((array) $this->connection->getConfig('schema'))
161+
$this->grammar->compileGetAllViews($this->getSchemas())
162162
);
163163
}
164164

@@ -261,6 +261,15 @@ public function getIndexes(string $table): array
261261
);
262262
}
263263

264+
/**
265+
* Get the schemas for the connection.
266+
*/
267+
protected function getSchemas(): array
268+
{
269+
$schemas = (array) $this->connection->getConfig('schema');
270+
return empty($schemas) ? ['public'] : $schemas;
271+
}
272+
264273
/**
265274
* Parse the table name and extract the schema and table.
266275
*

0 commit comments

Comments
 (0)