-
Notifications
You must be signed in to change notification settings - Fork 640
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
UpsertGraph deletes rows for relation which is not mentioned in graph #1455
Comments
Could you provide a reproduction for this? I don't believe this is really happening. There are tests for this case. I'll fix it immediately if you can provide a reproduction. |
Thanks for a quick response! I've created reproducible example: https://github.com/lynxtaa/objection-issue |
Thanks for the repro! I'll see what's going on asap. |
@koskimas any updates on this? |
I'll post here once I find time to work on this. |
Fix coming up soon. Sorry it took so long. |
Oh man, this was a pretty nasty bug! I can't believe why nobody reported this earlier. objection 1.6.10 will be released in couple of minutes. |
@koskimas Thank you! We are using Objection.js in production and very happy with it |
# Conflicts: # .travis.yml # doc/changelog/README.md # doc/guide/query-examples.md # lib/queryBuilder/QueryBuilder.js # lib/queryBuilder/QueryBuilderOperationSupport.js # lib/queryBuilder/graph/GraphUpsert.js # lib/queryBuilder/operations/UpdateAndFetchOperation.js # lib/relations/Relation.js # lib/transaction.js # package.json # tests/integration/misc/Vincit#1455.js # tests/integration/patch.js # typings/objection/index.d.ts
I'm using
[email protected]
and have these models:Suppose role with ID 1 already has set with ID 1.
If I'm using upsertGraph like this, It works correctly -- new row is inserted in "sets" table:
But if I pass "setAttributes" for newly created set, Objection deletes all setAttributes for the first set (with id=1):
Is this behaviour expected?
The text was updated successfully, but these errors were encountered: