bug: deleting attr from a generic will delete overridden versions on inheriting schema #6073
Labels
group/backend
Issue related to the backend (API Server, Git Agent)
type/bug
Something isn't working as expected
Milestone
Component
No response
Infrahub version
v1.1.9
Current Behavior
Say you have this schema in which
NodeB
inherits fromGenericA
and overridesGenericA.color
with a new default valueif you try to delete the attribute
color
fromGenericA
, then allcolor
attributes on any instances ofNodeA
will also be deletedExpected Behavior
overridden attributes and relationships on node schemas that inherit from a generic should not be affected when an attribute/relationship is deleted from the generic schema
Steps to Reproduce
models/base
to add this snippet toOrganizationManufacturer
OrganizationManufacturer
instancedescription
attribute on theOrganizationGeneric
schema to delete it by adding the following to the schemaOrganizationManufacturer
you created in step 4 will still show, but if you attempt to update it, nothing will happen. if you look at yourOrganizationManufacturer
at the database level, you will see that thedescription
attribute has been deletedAdditional Information
this is probably a bug in
NodeAttributeRemoveMigrationQuery01
I suspect that this cypher query removes all attributes of a given name under a given generic, which would include overridden attributes on inheriting schema. the fix is probably to update this query to explicitly ignore schema that have overridden the attribute in question
The text was updated successfully, but these errors were encountered: