---
# System prepended metadata

title: Functionality of brand new ddl

---

# Functionality of brand new ddl

## General functionality

[-] change space sharding function trigger
[-] change schema trigger
[-] transactional schema changing over instances
[-] schema must be delivered not only to sharded storage instances but also on all other types of instances even if cluster is not using Cartridge
[-] schema must have version
[-] ddl.check_schema(ddl.get_schema()) must not return any errors in any cases
[-] ddl.set_schema(ddl.get_schema()) must not return any errors in any cases
[-] all ddl API must be implemented in a way that would have on any version of core (1.x or 2.x) there was no need to use box API in any circumstances
[-] all interfaces must be compatible with box, for example: box.space['space_name'].index and ddl.get_schema().spaces['space_name'].indexes - this inconsistency doesn't allow easy drop-in replacement of box.space.* with ddl.ddl.get_schema().spaces['space_name'].*
[-] if implement all the stated in this document changes there is no reason not to swallow up http/lua API and mechanism of performing migrations right in ddl module
* [-] swallow up http endpoint to fire migrations from migrations module
        * [-] add the ability to run not all migrations but selected only
* [-] swallow up lua API to fire migrations from migrations module
        * [-] add the ability to run not all migrations but selected only
* [-] swallow up migrations loading API to change schema on production envs

## Check_schema

[-] space options
    [-] absence support of `field_count` option of space <-- must be deprecated!!!
    [-] absence support of `is_sync` option of space
    [-] absence support of `user` option of space
    [-] absence support of `enabled` option of space
    [-] `engine` option is mandatory but according to docs it has default value so it must not be mandatory
    [-] `temporary` option is mandatory but according to docs it has default value so it must not be mandatory
    [-] `is_local` option is mandatory but according to docs it has default value so it must not be mandatory
    [-] add `comment` option for space description metadata
    [-] add support of custom sharding functions
    [-] add support of ck_constraints
[-] format options
    [-] `is_nullable` option is mandatory but according to docs it has default value so it must not be mandatory
    [-] support of `fieldno` option for compatibility with some APIs and availability to strictly define of order of fields of space
    [-] standardize `comment` option for field description metadata
    [-] standardize `default` option for field default value
    [-] add support of blank format for schemaless spaces
[-] indexes
    [-] `unique` option is mandatory but according to docs it has default value so it must not be mandatory
    [-] `type` option is mandatory but according to docs it has default value so it must not be mandatory
    [-] absence support of `hint` option of index
    [-] add support of space functional indexes
    [-] add support of sequences
    [-] `dimension` option for RTREE is mandatory but according to docs it has default value so it must not be mandatory
    [-] `distance` option for RTREE is mandatory but according to docs it has default value so it must not be mandatory
    [-] indexes itself must not be mandatory
[-] index parts
    [-] add support of blank parts for index because of default {1, 'unsigned'}
    [-] index parts must be able to define by `fieldno` or `path` (field name)

## Set_schema

[-] all `check_schema` problems described above also applicable to set_schema
[-] set_schema must support all possible types of altering space format and changing it's options as well as all it's definition parts: indexes, functional indexes, sequences, ck_constraints:
[-] space format
    [-] change field name
    [-] change nullability
    [-] change comment
    [-] change type
    [-] add field
    [-] logical delete of field (mark it as deleted and fill by null, mostly asynchronously)
[-] indexes
    [-] add index
    [-] remove index
    [-] alter index
[-] ck_constraints
    [-] add ck_constraint
    [-] remove ck_constraint
    [-] alter ck_constraint
[-] sharding function
    [-] set custom sharding function
    [-] reset to default sharding function
[-] sequence
    [-] add sequence
    [-] remove sequence
    [-] alter sequence

## Get_schema

[-] space options
    [-] doesn't return `field_count` option of space <-- must be deprecated!!!
    [-] doesn't return `is_sync` option of space
    [-] doesn't return `user` option of space (user name or user id?)
    [-] doesn't return `enabled` option of space
    [-] add support of ck_constraints
    [-] add support of sharding function
    [-] add support of sequence
[-] format
    [-] must return `fieldno` of the field
    [-] field indexing must be available not only by name but also by fieldno index (ddl.get_schema().spaces['space_name'].format['field_name'] must return field definition of field 'field_name' as well as ddl.get_schema().spaces['space_name'].format(1) - must return field definition of field with filedno = 1). This approach is used in every application and why have to implement conversion from field name to filedno and reverse in API
[-] indexes
    [-] doesn't return `id` of index (0 - for primary)
    [-] doesn't return `hint` option of index
    [-] doesn't return any info about functional indexes
    [-] doesn't return any info about sequences
    [-] index indexing must be available not only by name but also by index id (ddl.get_schema().spaces['space_name'].indexes['primary'] must return index definition of 'primary' index as well as ddl.get_schema().spaces['space_name'].indexes(0) - must return index definition of primary index). This approach is used in every application and why have to implement conversion from field name to filedno and reverse in API
[-] index parts
    [-] must return not only `path` but also `fieldno` of the field
    [-] must return `exclude_null` option of index part

## Docs

[-] module API including all options must be fully documented
