Admin Api - Allow _sync upserts to reset/overwrite relations #3150
Closed
kingschnulli
started this conversation in
RFC / Proposal
Replies: 3 comments 7 replies
-
I would actually like to have such an option on upsert / update of the entity repository to remove all non provided entitiies (related to the foreign key). Doctrine ORM it would be called orphanRemoval if I remember correclty. But although it is similar, it is probably a different issue, therefore I created #3124 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey you both, I implemented the feature with this commit: 30e574c Hope this helps you in future projects. |
Beta Was this translation helpful? Give feedback.
6 replies
-
Implemented with this commit |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Effort: middle/high
Description:
Currently there is no way to overwrite or reset relations when using the batch/_sync api endpoint. This will always force to first delete all relations, then write them again - this also means you will have to either store or recieve all relationship ids before resetting them.
I would suggest having some sort of special bulk action that deletes all relationships of some kind like:
This would need only one part of the related primary key, not all of them.
Even better would be some kind of flexible interface to define the keys to resolve a relation when running any kind of bulk operation like:
Benefits
Highly improved performance and developer experience for 3rd Party ERP Systems when syncing data to/from shopware
Beta Was this translation helpful? Give feedback.
All reactions