We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The ddl module is responsible for applying the schema on the cluster. This module does not allow to modify the schema after applying it.
ddl
In Tarantool, there are two types of schema migration that do not require data migration:
To make it easier to write migrations, we should add the ability to expand the schema by adding nullable field to the end of the space.
Example of migrations:
Migration 1:
return { up = function() local ddl = require('ddl') local schema = { spaces = { keyval = { engine = 'memtx', is_local = false, temporary = false, format = { { name = 'bucket_id', type = 'unsigned', is_nullable = false }, { name = 'key', type = 'string', is_nullable = false }, { name = 'value', type = 'string', is_nullable = false } }, indexes = {{ name = 'pk', type = 'TREE', unique = true, parts = { { path = 'key', type = 'string', is_nullable = false } } }, { name = 'bucket_id', type = 'TREE', unique = false, parts = { { path = 'bucket_id', type = 'unsigned', is_nullable = false } } }}, sharding_key = { 'key' } } } } assert(ddl.check_schema(schema)) ddl.set_schema(schema) end }
Migration 2:
return { up = function() local ddl = require('ddl') local schema = { spaces = { keyval = { engine = 'memtx', is_local = false, temporary = false, format = { { name = 'bucket_id', type = 'unsigned', is_nullable = false }, { name = 'key', type = 'string', is_nullable = false }, { name = 'value', type = 'string', is_nullable = false }, { name = 'state', type = 'map', is_nullable = true } }, indexes = {{ name = 'pk', type = 'TREE', unique = true, parts = { { path = 'key', type = 'string', is_nullable = false } } }, { name = 'bucket_id', type = 'TREE', unique = false, parts = { { path = 'bucket_id', type = 'unsigned', is_nullable = false } } }}, sharding_key = { 'key' } } } } assert(ddl.check_schema(schema)) ddl.set_schema(schema) end }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The
ddl
module is responsible for applying the schema on the cluster.This module does not allow to modify the schema after applying it.
In Tarantool, there are two types of schema migration that do not require data migration:
To make it easier to write migrations, we should add the ability to
expand the schema by adding nullable field to the end of the space.
Example of migrations:
Migration 1:
Migration 2:
The text was updated successfully, but these errors were encountered: