Value type versions(值类型版本)¶
Value types are versioned to handle breaking and non-breaking edits. Value type versions include two parts: metadata and constraints. The metadata values for name, description, and apiName can be changed whenever necessary. The base type metadata and the constraints that define the validation rules for the type are immutable.
If you choose to update the constraints of a value type, a new version of the value type is created. If your value type has no consumers, you can freely change these constraints. However, if you make breaking changes to the constraints and your value type has consumers, we recommend deprecating the current value type and creating a new one instead. This approach avoids potential runtime errors and data inconsistencies.

When you make non-breaking changes to a value type, a new version is also created. This new version will automatically propagate to the Ontology, ensuring that all uses of the value type across the Ontology are updated to the latest version.
中文翻译¶
值类型版本¶
值类型(Value type)通过版本控制来处理破坏性变更和非破坏性编辑。值类型版本包含两个部分:元数据(metadata)和约束(constraints)。名称、描述和 apiName 的元数据值可随时更改。而基础类型元数据以及定义类型验证规则的约束则是不可变的。
如果选择更新值类型的约束,系统会创建该值类型的新版本。若值类型没有消费者,您可以自由更改这些约束。但若对约束进行破坏性变更且值类型存在消费者,建议弃用当前值类型并创建新的值类型。这种方法可避免潜在的运行时错误和数据不一致问题。

当对值类型进行非破坏性变更时,系统同样会创建新版本。该新版本将自动传播至本体(Ontology),确保本体中所有使用该值类型的位置均更新至最新版本。