Skip to content

Commit

Permalink
Use --no-owner and --no-acl with pg_restore
Browse files Browse the repository at this point in the history
Co-authored-by: Sean Frankruyter <s.frankruyter@gmail.com>
  • Loading branch information
tonysm and funkymonk91 committed Nov 20, 2020
1 parent 318c226 commit aa75618
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Schema/PostgresSchemaState.php
Expand Up @@ -25,7 +25,7 @@ public function dump(Connection $connection, $path)
})->implode(' ');

$this->makeProcess(
$this->baseDumpCommand().' --no-owner --file=$LARAVEL_LOAD_PATH '.$excludedTables
$this->baseDumpCommand().' --file=$LARAVEL_LOAD_PATH '.$excludedTables
)->mustRun($this->output, array_merge($this->baseVariables($this->connection->getConfig()), [
'LARAVEL_LOAD_PATH' => $path,
]));
Expand All @@ -39,7 +39,7 @@ public function dump(Connection $connection, $path)
*/
public function load($path)
{
$command = 'PGPASSWORD=$LARAVEL_LOAD_PASSWORD pg_restore --host=$LARAVEL_LOAD_HOST --port=$LARAVEL_LOAD_PORT --username=$LARAVEL_LOAD_USER --dbname=$LARAVEL_LOAD_DATABASE $LARAVEL_LOAD_PATH';
$command = 'PGPASSWORD=$LARAVEL_LOAD_PASSWORD pg_restore --no-owner --no-acl --host=$LARAVEL_LOAD_HOST --port=$LARAVEL_LOAD_PORT --username=$LARAVEL_LOAD_USER --dbname=$LARAVEL_LOAD_DATABASE $LARAVEL_LOAD_PATH';

if (Str::endsWith($path, '.sql')) {
$command = 'PGPASSWORD=$LARAVEL_LOAD_PASSWORD psql --file=$LARAVEL_LOAD_PATH --host=$LARAVEL_LOAD_HOST --port=$LARAVEL_LOAD_PORT --username=$LARAVEL_LOAD_USER --dbname=$LARAVEL_LOAD_DATABASE';
Expand Down

0 comments on commit aa75618

Please sign in to comment.