iTwin / imodel-transformer

API for exporting an iModel's parts and also importing them into another iModel
MIT License
3 stars 2 forks source link

Fixed onDeleteModel "Missing Id" and "ForeignKey constraint" errors #104

Closed DeividasDavidav closed 11 months ago

DeividasDavidav commented 11 months ago

"Missing Id: error deleting model" error: Added a fix and test for "Missing Id: error deleting model" which occured because onDeleteModel deleted definition model. It shouldn't delete definition model in onDeleteModel if its partition element will also be deleted, because elementTreeDeleter deletes definition model while deleting definition partition element.

"ForeignKey Constraint: error deleting model" error: Added a fix and test for this error. Transformer tries to delete models before it deletes elements. Definition models cannot be deleted unless all of their modeled elements are deleted first.