Skip to content

Commit e5e1ea8

Browse files
Add proper handling for non-default postgresql schema when performing a dump
1 parent d7f27d5 commit e5e1ea8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Illuminate/Database/Schema/PostgresSchemaState.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ class PostgresSchemaState extends SchemaState
1616
*/
1717
public function dump(Connection $connection, $path)
1818
{
19+
$schemaBuilder = $connection->getSchemaBuilder();
20+
$schema = $schemaBuilder->getConnection()->getConfig('schema');
21+
1922
$excludedTables = collect($connection->getSchemaBuilder()->getAllTables())
2023
->map->tablename
2124
->reject(function ($table) {
2225
return $table === $this->migrationTable;
23-
})->map(function ($table) {
24-
return '--exclude-table-data='.$table;
26+
})->map(function ($table) use ($schema) {
27+
return '--exclude-table-data='.$schema.'.'.$table;
2528
})->implode(' ');
2629

2730
$this->makeProcess(

0 commit comments

Comments
 (0)