Skip to content

Commit

Permalink
feat: Add --clean --if-exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Christie committed Jul 1, 2024
1 parent dec6f26 commit 41510ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sql-backup/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,13 @@

# Backup commands (for all databases) for the various database flavours...
BACKUP_COMMANDS = {
FLAVOUR_POSTGRESQL: 'pg_dumpall --username=%s --no-password'
FLAVOUR_POSTGRESQL: 'pg_dumpall --username=%s --no-password --clean --if-exists'
' | gzip > %s' % (PGUSER, BACKUP)
}
# Backup commands (for a single database).
# Check comments above in case they're relevant here.
BACKUP_COMMANDS_ONE_DB = {
FLAVOUR_POSTGRESQL: 'pg_dump --username=%s --no-password %s'
FLAVOUR_POSTGRESQL: 'pg_dump --username=%s --no-password --clean --if-exists %s'
' | gzip > %s' % (PGUSER, DATABASE, BACKUP)
}

Expand Down

0 comments on commit 41510ed

Please sign in to comment.