Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pg_dump): Add '--if-exists' option for pg_dump #511

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

DmytroLitvinov
Copy link

@DmytroLitvinov DmytroLitvinov commented Mar 5, 2024

Description

Add option --if-exists for pg_dump command.
Resolves #478

Checklist

Please update this checklist as you complete each item:

  • Tests have been developed for bug fixes or new functionality.
  • The changelog has been updated, if necessary.
  • Documentation has been updated, if necessary.
  • GitHub Issues closed by this PR have been linked.

By submitting this pull request I agree that all contributions comply with this project's open source license(s).

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 91.03%. Comparing base (8f1307e) to head (d698c78).

❗ Current head d698c78 differs from pull request most recent head 5d27e34. Consider uploading reports for the commit 5d27e34 to get more accurate results

Files Patch % Lines
dbbackup/db/postgresql.py 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #511      +/-   ##
==========================================
- Coverage   91.40%   91.03%   -0.38%     
==========================================
  Files          19       19              
  Lines         873      859      -14     
  Branches      157      151       -6     
==========================================
- Hits          798      782      -16     
- Misses         40       41       +1     
- Partials       35       36       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Archmonger
Copy link
Contributor

Archmonger commented Mar 6, 2024

I'm a bit uninformed here, but do you believe if exists should be the default behavior?

Also this can be merged after you create a simple unit test.

@DmytroLitvinov
Copy link
Author

Hey @Archmonger ,
It is not activated by default: https://github.com/jazzband/django-dbbackup/pull/511/files#diff-c9b41b9008c36f1e459cfb74e2a4c827a8635d9aa1703a90ba0945439af62026R103 (we do not break existing code). So if someone needs it, they will provide that option.

@Archmonger
Copy link
Contributor

Okay, I'm going to assume that you're saying having if_exists defaulting to False is the best choice.

Copy link
Contributor

@Archmonger Archmonger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR can be merged after you create a simple unit test.

@Archmonger
Copy link
Contributor

Tests are broken, will need to be fixed.

@WillNilges
Copy link

Should be fixed in my branch. Sorry about that.

@Archmonger
Copy link
Contributor

@DmytroLitvinov Can you remerge with his branch?

@DmytroLitvinov
Copy link
Author

@Archmonger , could you help with the issue in CI?
https://github.com/jazzband/django-dbbackup/actions/runs/8678806552/job/23796332662?pr=511
Can't get what is going on here

@Archmonger
Copy link
Contributor

Seems to be related the Python v3.7 tests

py37-django32: FAIL code 1 (19.58=setup[17.04]+cmd[2.54] seconds)

@Archmonger
Copy link
Contributor

Marking this as draft due to tests failing

@Archmonger Archmonger marked this pull request as draft August 22, 2024 21:53
@Archmonger Archmonger changed the title feat(pg_dump): Add '--if-exists' option for pg_dump (#478) feat(pg_dump): Add '--if-exists' option for pg_dump Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dbrestore fails with non-existent relation
3 participants