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

fix: Foreign Key Violations During Backup Restore #2986

Conversation

michael-genson
Copy link
Collaborator

@michael-genson michael-genson commented Jan 13, 2024

What type of PR is this?

(REQUIRED)

  • bug

What this PR does / why we need it:

(REQUIRED)

This PR removes objects with invalid foreign keys when doing a database restore. Prior to this PR, any databases containing objects with invalid foreign keys will fail to restore on postgres due to foreign key checks.

Which issue(s) this PR fixes:

(REQUIRED)

Fixes #2499
Fixes #2985

@michael-genson michael-genson marked this pull request as ready for review January 15, 2024 00:21
@michael-genson
Copy link
Collaborator Author

I manually confirmed the data locally looks correct. The number of recipes matches, the number of users matches, and the expected invalid foreign keys are missing.

Copy link
Collaborator

@hay-kot hay-kot left a comment

Choose a reason for hiding this comment

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

This is so much more simple than what I tried to do 10/10

mealie/services/backups_v2/alchemy_exporter.py Outdated Show resolved Hide resolved
@michael-genson michael-genson merged commit 2a5997a into mealie-recipes:mealie-next Jan 16, 2024
9 checks passed
@michael-genson michael-genson deleted the fix/foreign-key-violations-during-migration branch January 16, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants