Skip to content

bug: updating attribute unique does not add/remove from Template schemas #8894

Description

@ajtmccarty

Component

API Server / GraphQL

Infrahub version

1.8.4

Current Behavior

only attributes with unique=False and read-only=False should be included in the Template schema generated for a given Node schema. but if I update an attribute from unique=True to unique=False, then the attribute is not added to existing Template instances for the Node

Expected Behavior

update the uniqueness of an attribute should correctly update any existing instances of Template schemas for the node to add/remove the attribute as appropriate

Steps to Reproduce

  1. load a schema that includes a unique attribute and has generate_template=True
  2. create an instance of the Template schema for your schema from step 1
  3. load an updated version of the schema from step 1 that sets the unique attribute to be non-unique
  4. the attribute should be added to the Template schema and be updateable on the Template instance from step 2, but it is not

Additional Information

the fix requires adding a new attribute.unique.update migration that does something similar to the AttributeSupportsGeneratedSchemaMigration migration

Metadata

Metadata

Labels

type/bugSomething isn't working as expected

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions