IFC-858 Cascade delete with relationship identifiers generated from generics #5538
+51
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR does not contain a fix yet. However it highlights the issue which is caused by relationship identifiers that will get generated automatically but won't match when a relationship is set at the generic level. This will cause
NodeDeleteIndex
andNodeDeleteValidator
not to pick up the cascade delete and therefore prevent it.Using the schema given as an example in #4780, the generated relationship identifiers will be:
testinterface__testinterfaceholder
for theinterfaces
relationship ofInfraDevice
toInfraInterface
testdevice__testinterface
for thedevice
relationship ofInfraInterface
toInfraDevice
.For cascade delete to work the would need to be both identified by either
testinterface__testinterfaceholder
ortestdevice__testinterface
but not a mix of both.There are few potential fixes which will impact the already loaded schemas:
testdevice__testinterface
.testinterface__testinterfaceholder
.The first solution seems to be the more appropriate one (from my point of view) but this might have some consequences on existing schemas as relationship identifiers will likely be re-generated.
A temporary workaround for #4780 is also the set the identifiers in the schema file so that they match.