Skip to content

Commit

Permalink
Use --file and --format with pg_dump
Browse files Browse the repository at this point in the history
  • Loading branch information
ianballou committed Jul 24, 2024
1 parent 5814c0e commit efa2395
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/foreman_maintain/concerns/base_database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def ping(config = configuration)
end

def dump_db(file, config = configuration)
execute!(dump_command(config) + " > #{file}", :hidden_patterns => [config['password']], :user => config['user'])
execute!(dump_command(config) + " -f #{file}", :hidden_patterns => [config['password']], :user => config['user'])

Check failure on line 76 in lib/foreman_maintain/concerns/base_database.rb

View workflow job for this annotation

GitHub Actions / rubocop / Rubocop

Layout/LineLength: Line is too long. [121/100]
end

def restore_dump(file, localdb, config = configuration)
Expand Down Expand Up @@ -169,9 +169,9 @@ def psql_command(config)

def dump_command(config)
if config['connection_string']
"pg_dump -Fc #{config['connection_string']}"
"pg_dump --format=c #{config['connection_string']}"
else
base_command(config, 'pg_dump') + " -Fc #{config['database']}"
base_command(config, 'pg_dump') + " --format=c #{config['database']}"
end
end

Expand Down

0 comments on commit efa2395

Please sign in to comment.