stop using local_rels/attrs in schema update #5595
Open
+289
−12
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.
IFC-1090
made a followup issue to remove duplicated inherited relationship/attribute data from the database: IFC-1201
loading an extension of a schema that inherits a relationship from a generic can cause the inherited relationship on the schema to be deleted.
the code seems to indicate that we assume a given
SchemaNode
in the database will only have its non-inherited ("local") relationships linked and will NOT have any inherited relationships, but this is not how it actually works at the database level. aSchemaNode
will be connected toSchemaRelationship
s for every one of its relationships, whether they are inherited from a generic or notan example from the database

the red path is for the
interfaces
relationship on a generic schema and the green path is for the inheritedinterfaces
relationship on a node schema. both theSchemaGeneric
andSchemaNode
include this relationship even though it is only defined on the genericmy fix for this issue is to consider all relationships and attributes when updating a schema for a node instead of just the inherited/local ones. this does fix the problem, but I am worried that there may be side effects that are not covered by our current test suite b/c we don't have a lot of tests for loading/updating schema