-
Notifications
You must be signed in to change notification settings - Fork 120
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
@Unique with replace strategy that update instead of deleting and inserting a new one #468
Comments
Agreed. This messes up relations big time and since neither non-integer primary keys nor composite indices are supported, relations are currently a nightmare to deal with. Unfortunately other packages like isar suffer pretty much the same issues :( I'll try an ugly workaround in the meanwhile lol:
|
In case of saving multiple objects(putMany)? and what if there's a subobjects that I also want to handle? |
Thanks for the request! Please thumbs up the first post, if you are interested in this. |
Thanks! At this point when using AFAIK this is not different from traditional relational databases? Anyhow, I could have sworn we documented this, but it's not. So I'll add a note to the docs to be careful when using relations. |
Right now, @unique with conflict: ConflictStrategy.replace remove the old object and insert a new one, this behavior causes a null relation if there's data that has relation to the old object(the one before deleting), and after deleting and inserting a new object, the related item's relations aren't updated to the new object.
The text was updated successfully, but these errors were encountered: