When re-defining an existing schema attribute type, user has to provide the value, which is inconsistent
Description
When re-defining an existing schema attribute type, user has to provide the value (string, long, etc) or else gets an error.
This is inconsistent with existing roles played or related or attributes owned, which do not have to be explicitly re-defined.
Environment
- OS (where TypeDB server runs): Mac OS 10
- TypeDB version (and platform): TypeDB 2.6.0
- TypeDB client: console
Reproducible Steps
Let's say we have a schema with friendship defined thus:
define friendship sub relation,
relates friend,
plays happy-relation,
owns start-date;
Later on, we want to update friendship, e.g. to make it abstract.
If the schema allows it (non-abstract types can't own abstract attributes or relate or play abstract roles), we can just write
define friendship sub relation, abstract;
without having to redefine the roles that friendship plays or relates, nor attributes that it owns. We only have to specify the new fact that it should be abstract.
But there is an exception to this!
If friendship were instead defined initially as an attribute inheriting from the root attribute type, e.g.
define friendship sub attribute, value string;
and we tried to redefine it later to make it abstract, we'd get
[TYW12] Invalid Type Write: The attribute type 'friendship' is missing a value type.
and would have to include value string or similar when re-defining it to make it work.
Seems to be related to #6510.
This is still valid, and a different issue to that fixed by #6790