You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when restoring a backup, any rows with invalid foreign keys are dropped (see #2986). This is a fair "catch-all" solution, but we can do better for more common issues (such as #3171)
Proposed/Possible Solution(s)?
Scan the database JSON before attempting to import and fix some common issues. Specifically, looking at #3171, I can think of two:
It would be kind of nice if there was a placeholder user and group that could be used for orphaned entries. like a group that you cant be added to, and a user that cant be logged in as that are just for placeholders in these situations.
What is the problem this task addresses?
Currently, when restoring a backup, any rows with invalid foreign keys are dropped (see #2986). This is a fair "catch-all" solution, but we can do better for more common issues (such as #3171)
Proposed/Possible Solution(s)?
Scan the database JSON before attempting to import and fix some common issues. Specifically, looking at #3171, I can think of two:
user_id
is found, replace it with a valid one (find any admin user, similar to: feat: Filter Out Shopping Lists That Aren't Yours #3213)group_id
is found, replace it with a valid one (using an admin user, same as above)This should fix the most egregious of errors (e.g. deleting recipes that belong to missing users)
Similarly, when users are deleted, their recipes should be re-assigned
The text was updated successfully, but these errors were encountered: