-
Notifications
You must be signed in to change notification settings - Fork 2
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
Foreign Key Constraint error when deleting an element that is referenced in other elements as code scope #61
Comments
We can port your suggested fix to a Do we need to add additional sanity checks though that the transformer should only delete this element if its other references (the scope one that currently errors) are also being deleted? |
Okay, I will make a PR and add a sanity check that ensures that this element would only be deleted if all code scope references are also being deleted. |
this was fixed by #75, closing |
Describe the bug
When using onDeleteElement() function from IModelImporter to delete an element, if an element is referenced by other elements in their code scopes, it throws Foreign key constraint error. That is because ElementTreeDeleter doesn't find elements with code scope references to specific element when deleting it. (Already created an issue with possible solution in itwins-core (iTwin/itwinjs-core#5576) but they said that ElementTreeDeleter shouldn't solve this relationship issue)
To Reproduce
Expected behavior
When deleting an element, it should also process the elements that reference the element in their code scopes.
Desktop (please complete the applicable information):
The text was updated successfully, but these errors were encountered: