-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
69 lines (65 loc) · 1.73 KB
/
Copy pathinit.lua
File metadata and controls
69 lines (65 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
s = box.schema.space.create('user')
s:format({
{name = 'id', type = 'unsigned'},
{name = 'name', type = 'string'},
{name = 'surname', type = 'string'},
{name = 'patronymic', type = 'string'},
{name = 'date_of_birth', type = 'string'},
{name = 'avatar', type = 'string'},
{name = 'estimate', type = 'double'},
{name = 'email', type = 'string'},
{name = 'phone', type = 'string'},
{name = 'sex', type = 'boolean'},
{name = 'city', type = 'string'},
{name = 'education', type = 'string'}
})
s:create_index('primary', {
type = 'hash',
parts = {'id'}
})
s:create_index('secondary', {
type = 'hash',
parts = {'name', 'surname', 'patronymic'}
})
s = box.schema.space.create('publication')
s:format({
{name = 'id', type = 'unsigned'},
{name = 'user_id', type = 'unsigned'},
{name = 'type', type = 'unsigned'},
{name = 'sentiment', type = 'unsigned'},
{name = 'date', type = 'string'},
{name = 'date', type = 'string'},
{name = 'link', type = 'string'},
{name = 'content', type = 'string'},
})
s:create_index('primary', {
type = 'hash',
parts = {'id'}
})
s:create_index('secondary', {
type = 'hash',
parts = {'user_id'}
})
s = box.schema.space.create('mention')
s:format({
{name = 'id', type = 'unsigned'},
{name = 'user_id', type = 'unsigned'},
{name = 'sentiment', type = 'unsigned'},
{name = 'date', type = 'string'},
{name = 'link', type = 'string'},
{name = 'content', type = 'string'}
})
s:create_index('primary', {
type = 'hash',
parts = {'id'}
})
s = box.schema.space.create('friend')
s:format({
{name = 'first_user_id', type = 'unsigned'},
{name = 'second_user_id', type = 'unsigned'},
{name = 'id', type = 'unsigned'}
})
s:create_index('primary', {
type = 'hash',
parts = {'id'}
})