【发布时间】:2020-07-22 00:36:45
【问题描述】:
我需要在现有空间中添加一个参数并保留现有数据。
空间是这样创建的:
function create_user()
local space = box.schema.create_space('user', { engine = 'memtx' })
space:format({
{ name = 'user_id', type = 'unsigned' },
{ name = 'name', type = 'string' },
{ name = 'is_active', type = 'boolean' },
})
space:create_index('users_id', { type = 'TREE', parts = { 'user_id', 'name' } })
end
我需要添加以下参数
{ name = 'is_online', type = 'boolean' }
{ name = 'session_id', type = 'unsigned', is_nullable = true }
如何编写所需的迁移脚本?
【问题讨论】: