From 5d3ac49ba82fe391155577a07d46707c13f07900 Mon Sep 17 00:00:00 2001 From: Tony Messias Date: Fri, 20 Nov 2020 16:02:25 -0300 Subject: [PATCH] Use --no-owner and --no-acl with pg_restore command Co-authored-by: Sean Frankruyter --- src/Illuminate/Database/Schema/PostgresSchemaState.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Schema/PostgresSchemaState.php b/src/Illuminate/Database/Schema/PostgresSchemaState.php index 8349a0b53083..179db6189c55 100644 --- a/src/Illuminate/Database/Schema/PostgresSchemaState.php +++ b/src/Illuminate/Database/Schema/PostgresSchemaState.php @@ -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, ])); @@ -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';