Change a type defined in the schema. The change is persistent.
Syntax
ALTER TYPE <type> [<attribute-name> <attribute-value>] [CUSTOM <custom-key> = <custom-value>]
-
<type>
Defines the type you want to change. -
<attribute-name>
Defines the attribute you want to change. For a list of supported attributes, see the table below. -
<attribute-value>
Defines the value you want to set. -
<custom-key>
Name of the custom property to set. -
<custom-value>
Value for the custom property. All data types are supported as values.
Examples
-
Add
Person
to the super types:
ArcadeDB> ALTER TYPE Employee SUPERTYPE +Person
-
Remove a super-type:
ArcadeDB> ALTER TYPE Employee SUPERTYPE -Person
-
Add the "account2" bucket to the type
Account
.
ArcadeDB> ALTER TYPE Account BUCKET +account2
In the event that the bucket does not exist, it automatically creates it.
-
Remove a bucket from the type
Account
with the ID34
:
ArcadeDB> ALTER TYPE Account BUCKET -34
-
Modify the bucket selection strategy to
partitioned
selecting the property id as partition key:
ArcadeDB> ALTER TYPE Account BucketSelectionStrategy `partitioned('id')`
-
Set the custom value with key 'description':
ArcadeDB> ALTER TYPE Account CUSTOM description = 'All users'
-
Set the custom nested value with key 'meta':
ArcadeDB> ALTER TYPE Account CUSTOM meta = { abool: true, alist: [1,2,3,4,5]};
-
Change the type name from 'Account' to 'Client':
ArcadeDB> ALTER TYPE Account NAME Client;
For more information, see:
Supported Attributes
Attribute | Type | Support | Description |
---|---|---|---|
|
Identifier |
Changes the type name. |
|
|
Identifier |
Defines a super-type for the type. Use |
|
|
Identifier or Integer |
|
|
|
Identifier |
Change the selection of the bucket when new records are created. Using |