-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathДИАГРАММА
83 lines (70 loc) · 1.37 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Table character {
id int [pk]
type_id int [ref: > type.id]
name varchar
birthday date
history text
sex_id int [ref: > sex.id]
place_of_living_id int [ref: > location.id]
location_id int [ref: > location.id]
group int [ref: > group.id]
favor_id int [ref: > favor.id]
Indexes {
location_id [type: hash]
}
}
Table type {
id int [pk]
name varchar
}
Table sex {
id int [pk]
name varchar
}
Table murder {
id int [pk]
killer_id int [ref: > character.id]
victim int [ref: > character.id]
description varchar
date timestamp
}
Table location {
id int [pk]
lat int
lon int
name varchar
is_place_of_living boolean
}
Table vampire_to_servant {
servant_id int [ref: > character.id]
vampire_id int [ref: > character.id]
}
Table group {
id int [pk]
location_id int [ref: > location.id]
admin_id int [ref: > character.id]
name varchar
}
Table location_history {
character_id int [ref: > character.id]
location_id int [ref: > location.id]
visit_time timestamp
}
Table court {
id int [pk]
verdict varchar
date date
defendant_id int [ref: > character.id]
group_id int [ref: > group.id]
location_id int [ref: > location.id]
}
Table passes {
character_id int [ref: > character.id]
location_id int [ref: > location.id]
}
Table favor {
id int [pk]
sex_id int [ref: > sex.id] // optional
age_min int
age_max int
}