diff --git a/backend/infrahub/core/migrations/graph/m020_add_generate_template_attr.py b/backend/infrahub/core/migrations/graph/m020_add_generate_template_attr.py index 1594e4956f..4f0f7c64cf 100644 --- a/backend/infrahub/core/migrations/graph/m020_add_generate_template_attr.py +++ b/backend/infrahub/core/migrations/graph/m020_add_generate_template_attr.py @@ -23,7 +23,6 @@ class Migration020(InternalSchemaMigration): def init(cls, **kwargs: dict[str, Any]) -> Self: internal_schema = cls.get_internal_schema() schema_node = internal_schema.get_node(name="SchemaNode") - schema_generic = internal_schema.get_node(name="SchemaGeneric") migrations = [ NodeAttributeAddMigration( @@ -32,14 +31,7 @@ def init(cls, **kwargs: dict[str, Any]) -> Self: schema_path=SchemaPath( schema_kind="SchemaNode", path_type=SchemaPathType.ATTRIBUTE, field_name="generate_template" ), - ), - NodeAttributeAddMigration( - new_node_schema=schema_generic, - previous_node_schema=schema_generic, - schema_path=SchemaPath( - schema_kind="SchemaNode", path_type=SchemaPathType.ATTRIBUTE, field_name="generate_template" - ), - ), + ) ] return cls(migrations=migrations, **kwargs) # type: ignore[arg-type] diff --git a/backend/infrahub/core/schema/definitions/internal.py b/backend/infrahub/core/schema/definitions/internal.py index ba128e81eb..f8feb6fc11 100644 --- a/backend/infrahub/core/schema/definitions/internal.py +++ b/backend/infrahub/core/schema/definitions/internal.py @@ -866,14 +866,6 @@ def to_dict(self) -> dict[str, Any]: optional=True, extra={"update": UpdateSupport.VALIDATE_CONSTRAINT}, ), - SchemaAttribute( - name="generate_template", - kind="Boolean", - description="Indicate if an object template schema should be generated for this schema", - default_value=False, - optional=True, - extra={"update": UpdateSupport.ALLOWED}, - ), SchemaAttribute( name="used_by", kind="List", diff --git a/backend/infrahub/core/schema/generated/genericnode_schema.py b/backend/infrahub/core/schema/generated/genericnode_schema.py index b88a181ded..41e35a30bc 100644 --- a/backend/infrahub/core/schema/generated/genericnode_schema.py +++ b/backend/infrahub/core/schema/generated/genericnode_schema.py @@ -18,11 +18,6 @@ class GeneratedGenericSchema(BaseNodeSchema): description="Indicate if a profile schema should be generated for this schema", json_schema_extra={"update": "validate_constraint"}, ) - generate_template: bool = Field( - default=False, - description="Indicate if an object template schema should be generated for this schema", - json_schema_extra={"update": "allowed"}, - ) used_by: list[str] = Field( default_factory=list, description="List of Nodes that are referencing this Generic", diff --git a/backend/infrahub/core/schema/schema_branch.py b/backend/infrahub/core/schema/schema_branch.py index c56d29a764..72f1505e9d 100644 --- a/backend/infrahub/core/schema/schema_branch.py +++ b/backend/infrahub/core/schema/schema_branch.py @@ -1779,7 +1779,7 @@ def manage_object_template_relationships(self) -> None: This relationship allows to record from which template an object has been created. """ - for node_name in self.node_names + self.generic_names: + for node_name in self.node_names: node = self.get(name=node_name, duplicate=False) if ( @@ -1933,7 +1933,7 @@ def manage_object_template_schemas(self) -> None: need_templates: set[NodeSchema | GenericSchema] = set() template_schema_kinds: set[str] = set() - for node_name in self.node_names + self.generic_names: + for node_name in self.node_names: node = self.get(name=node_name, duplicate=False) # Delete old object templates if schemas were removed diff --git a/docs/docs/reference/schema/generic.mdx b/docs/docs/reference/schema/generic.mdx index 82f248f44c..111e84a4fd 100644 --- a/docs/docs/reference/schema/generic.mdx +++ b/docs/docs/reference/schema/generic.mdx @@ -20,7 +20,6 @@ Below is the list of all available options to define a Generic in the schema | [**display_labels**](#display_labels) | Attribute | List of attributes to use to generate the display label | False | | [**documentation**](#documentation) | Attribute | Link to a documentation associated with this object, can be internal or external. | False | | [**generate_profile**](#generate_profile) | Attribute | Indicate if a profile schema should be generated for this schema | False | -| [**generate_template**](#generate_template) | Attribute | Indicate if an object template schema should be generated for this schema | False | | [**hierarchical**](#hierarchical) | Attribute | Defines if the Generic support the hierarchical mode. | False | | [**human_friendly_id**](#human_friendly_id) | Attribute | Human friendly and unique identifier for the object. | False | | [**icon**](#icon) | Attribute | Defines the icon to use in the menu. Must be a valid value from the MDI library https://icon-sets.iconify.design/mdi/ | False | @@ -105,17 +104,6 @@ Below is the list of all available options to define a Generic in the schema | **Default Value** | True | | **Constraints** | | -### generate_template - -| Key | Value | -| ---- | --------------- | -| **Name** | generate_template | -| **Kind** | `Boolean` | -| **Description** | Indicate if an object template schema should be generated for this schema | -| **Optional** | True | -| **Default Value** | False | -| **Constraints** | | - ### hierarchical | Key | Value | diff --git a/docs/docs/reference/schema/validator-migration.mdx b/docs/docs/reference/schema/validator-migration.mdx index 23f1c8833c..5a63647165 100644 --- a/docs/docs/reference/schema/validator-migration.mdx +++ b/docs/docs/reference/schema/validator-migration.mdx @@ -116,6 +116,5 @@ In this context, an element represent either a Node, a Generic, an Attribute or | **documentation** | allowed | | **hierarchical** | validate_constraint | | **generate_profile** | validate_constraint | -| **generate_template** | allowed |