Skip to content

Commit b8ec9a2

Browse files
committed
Adding data to tarantool
1 parent 7794c85 commit b8ec9a2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

samples/docker-compose/tarantool/sample.init.lua

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ local function init()
2525
box.schema.user.create('replicator', {password = '234234', if_not_exists = true})
2626
box.schema.user.grant('replicator','execute','role','replication', { if_not_exists = true })
2727

28-
some_space = box.schema.space.create('some_space', { field_count = 5, format = {
28+
some_space = box.schema.space.create('some_space', { field_count = 3, format = {
2929
[1] = {["name"] = "id"},
3030
[2] = {["name"] = "text"},
3131
[3] = {["name"] = "int"}
@@ -34,7 +34,7 @@ local function init()
3434

3535
some_space:create_index('primary', {
3636
if_not_exists = true,
37-
type = 'HASH',
37+
type = 'TREE',
3838
unique = true,
3939
parts = {1, 'INT'}
4040
})
@@ -47,4 +47,10 @@ local function init()
4747
})
4848
end
4949

50-
box.once('init', init)
50+
local function data()
51+
box.space.some_space:auto_increment{'Masya', 10}
52+
box.space.some_space:auto_increment{'Armata', 0}
53+
end
54+
55+
box.once('init', init)
56+
box.once('data', data)

0 commit comments

Comments
 (0)