Migration script with ddl.set_schema() fails if it has index definition with exclude_null option in index parts.
There are to different error depending on presence is_nullable = false, option in definition.
Migration script:
return {
up = function()
local ddl = require('ddl')
local schema = {
spaces = {
message = {
engine = 'memtx',
is_local = false,
temporary = false,
format = {
{ name = 'id', type = 'integer', is_nullable = false },
{ name = 'bucket_id', type = 'unsigned', is_nullable = false },
{ name = 'user_key', type = 'string', is_nullable = false },
{ name = 'package_id', type = 'integer', is_nullable = true }
},
indexes = {
{
name = 'primary',
type = 'TREE',
unique = true,
parts = {
{
path = 'id',
is_nullable = false,
type = 'integer'
}
}
},
{
name = 'bucket_id',
type = 'TREE',
unique = false,
parts = {
{
path = 'bucket_id',
is_nullable = false,
type = 'unsigned'
}
}
},
{
name = 'package_id_idx',
type = 'TREE',
unique = false,
parts = {
{
path = 'package_id',
exclude_null = true,
type = 'integer'
}
}
}
},
sharding_key = { 'id' }
}
}
}
ddl.set_schema(schema)
return ddl.check_schema(schema)
end
}
Migration script with ddl.set_schema() fails if it has index definition with
exclude_null
option in index parts. There are to different error depending on presenceis_nullable = false,
option in definition.Migration script: