Skip to content

Latest commit

 

History

History
64 lines (48 loc) · 2.57 KB

SQL-Alter-Property.adoc

File metadata and controls

64 lines (48 loc) · 2.57 KB

SQL - ALTER PROPERTY

edit

Change a property defined in the schema. The change is persistent.

Syntax

ALTER PROPERTY <type-name>.<property-name> <attribute-name> <attribute-value> [CUSTOM <custom-key> = <custom-value>]
  • <type-name> Defines the type where the property is defined

  • <property-name> Defines the property in the type-name 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

    • mandatory <true|false> If true, the property must be present. Default is false

    • notnull <true|false> If true, the property, if present, cannot be null. Default is false

    • readonly <true|false> If true, the property cannot be changed after the creation of the record. Default is false

    • min <number|string> Defines the minimum value for this property. For number types it is the minimum number as a value. For strings, it represents the minimum number of characters. For dates is the minimum date (uses the database date format). For collections (lists, sets, maps) this attribute determines the minimally required number of elements.

    • max <number|string> Defines the maximum value for this property. For number types it is the maximum number as a value. For strings, it represents the maximum number of characters. For dates is the maximum date (uses the database date format). For collections (lists, sets, maps) this attribute determines the maximally allowed number of elements.

    • regexp <string> Defines the mask to validate the input as a Regular Expression

    • default <any> Defines default value if not present. Default is null.

  • <custom-key> Name of the custom property to set

  • <custom-value> Value for the custom property. All data types are supported as values.

Examples

  • Set the property 'subscribedOn' as mandatory:

ArcadeDB> ALTER PROPERTY User.subscribedOn MANDATORY true
  • Set the property 'createdOn' as read-only

ArcadeDB> ALTER PROPERTY User.createdOn READONLY true
  • Set the custom value with key 'description':

ArcadeDB> ALTER PROPERTY Account.signedOn CUSTOM description = 'First Sign In'

For more information, see: