Skip to content
lvca edited this page Dec 22, 2012 · 2 revisions

SQL command: ALTER CLASS

Alter Class

The SQL Alter Class command alters a class in the schema.

Syntax

    ALTER CLASS <class> <attribute-name> <attribute-value>

Where:

  • class is the class name to change
  • attribute-name, is the attribute name to alter. Supported attribute names are:
  • NAME, the class name. Accepts a string as value
  • SHORTNAME, the short name. Accepts a string as value. NULL to remove it
  • SUPERCLASS, the superclass name to assign. Accepts a string as value. NULL to remove it
  • OVERSIZE, the oversize factor. Accepts a decimal number as value
  • ADDCLUSTER, add a cluster to be part of the class (since v1.1.0)
  • REMOVECLUSTER, remove a cluster from a class. The cluster will be not deleted. (since v1.1.0)
  • STRICTMODE, enable or disable the strict mode. With the strict mode enabled you work in schema-full mode and you can't add new properties in record if the class
  • CUSTOM, to set custom properties. Property name and value must be expressed using the syntax: "<name>=<value>" without spaces between name and value
  • attribute-value, is the new attribute value to set

Examples

Change the name of the class 'Account':

    ALTER CLASS Account NAME Seller

Change the oversize factor of the class 'Account':

    ALTER CLASS Account OVERSIZE 2

Adds a cluster by name to a class (since v1.1.0):

    ALTER CLASS Account ADDCLUSTER account2

Removes a cluster by id to a class (since v1.1.0):

    ALTER CLASS Account REMOVECLUSTER 34

Add custom properties (in this case used in Record level security):

    ALTER CLASS Post CUSTOM onCreate.fields=_allowRead,_allowUpdate
    ALTER CLASS Post CUSTOM onCreate.identityType=role

To create a class use the Create Class command, to remove a class use the Drop Class command.

To know more about other SQL commands look at SQL commands.

This is a command of the Orient console. To know all the commands go to Console-Commands.

Clone this wiki locally