Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,23 +233,23 @@ public function compileDropAllTypes($types)
/**
* Compile the SQL needed to retrieve all table names.
*
* @param string $schema
* @param string|array $schema
* @return string
*/
public function compileGetAllTables($schema)
{
return "select tablename from pg_catalog.pg_tables where schemaname = '{$schema}'";
return "select tablename from pg_catalog.pg_tables where schemaname in ('".implode("','", (array) $schema)."')";
}

/**
* Compile the SQL needed to retrieve all view names.
*
* @param string $schema
* @param string|array $schema
* @return string
*/
public function compileGetAllViews($schema)
{
return "select viewname from pg_catalog.pg_views where schemaname = '{$schema}'";
return "select viewname from pg_catalog.pg_views where schemaname in ('".implode("','", (array) $schema)."')";
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Database/Schema/PostgresBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function dropAllTables()
{
$tables = [];

$excludedTables = ['spatial_ref_sys'];
$excludedTables = $this->connection->getConfig('excluded_drop_tables') ?? ['spatial_ref_sys'];

foreach ($this->getAllTables() as $row) {
$row = (array) $row;
Expand Down Expand Up @@ -105,7 +105,7 @@ public function dropAllTypes()
public function getAllTables()
{
return $this->connection->select(
$this->grammar->compileGetAllTables($this->connection->getConfig('schema'))
$this->grammar->compileGetAllTables((array) $this->connection->getConfig('schema'))
);
}

Expand All @@ -117,7 +117,7 @@ public function getAllTables()
protected function getAllViews()
{
return $this->connection->select(
$this->grammar->compileGetAllViews($this->connection->getConfig('schema'))
$this->grammar->compileGetAllViews((array) $this->connection->getConfig('schema'))
);
}

Expand Down