Skip to content

Commit

Permalink
Add proper handling for non-default postgresql schema when performing…
Browse files Browse the repository at this point in the history
… a dump
  • Loading branch information
emiliopedrollo committed Jan 20, 2021
1 parent d7f27d5 commit e5e1ea8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Illuminate/Database/Schema/PostgresSchemaState.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ class PostgresSchemaState extends SchemaState
*/
public function dump(Connection $connection, $path)
{
$schemaBuilder = $connection->getSchemaBuilder();
$schema = $schemaBuilder->getConnection()->getConfig('schema');

$excludedTables = collect($connection->getSchemaBuilder()->getAllTables())
->map->tablename
->reject(function ($table) {
return $table === $this->migrationTable;
})->map(function ($table) {
return '--exclude-table-data='.$table;
})->map(function ($table) use ($schema) {
return '--exclude-table-data='.$schema.'.'.$table;
})->implode(' ');

$this->makeProcess(
Expand Down

0 comments on commit e5e1ea8

Please sign in to comment.