-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.dbml
executable file
·220 lines (188 loc) · 3.29 KB
/
database.dbml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
table users {
id int
email text
password_hash text
username text
first_name text
last_name text
is_admin boolean
session_id text
created_at timestamp
deleted_at timestamp
}
table players {
id int
first_name text
last_name text
designator text
user_id int
created_at timestamp
deleted_at timestamp
}
ref: players.user_id > users.id
table sports {
id int
name text
created_at timestamp
deleted_at timestamp
}
table positions {
id int
name text
created_at timestamp
deleted_at timestamp
}
table objectives {
id int
name text
value int
sport_id int
created_at timestamp
deleted_at timestamp
}
ref: objectives.sport_id > sports.id
table leagues {
id int
name text
format text
status text
owner_id int
sport_id int
created_at timestamp
deleted_at timestamp
}
ref: leagues.owner_id > users.id
ref: leagues.sport_id > sports.id
table seasons {
id int
name text
format text
status text
start_date timestamp
end_date timestamp
league_id int
created_at timestamp
deleted_at timestamp
}
ref: seasons.league_id > leagues.id
table teams {
id int
name text
league_id int
created_at timestamp
deleted_at timestamp
}
ref: teams.league_id > leagues.id
table matches {
id int
name text
status text
season_id int
created_at timestamp
deleted_at timestamp
}
ref: matches.season_id > seasons.id
table sets {
id int
name text
status text
season_id int
match_id int
created_at timestamp
deleted_at timestamp
}
ref: sets.season_id > seasons.id
ref: sets.match_id > matches.id
table games {
id int
name text
status text
season_id int
match_id int
set_id int
created_at timestamp
deleted_at timestamp
}
ref: games.season_id > seasons.id
ref: games.match_id > matches.id
ref: games.set_id > sets.id
table team_players {
id int
team_id int
player_id int
position_id int
created_at timestamp
deleted_at timestamp
}
ref: team_players.team_id > teams.id
ref: team_players.player_id > players.id
ref: team_players.position_id > positions.id
table game_teams {
id int
game_id int
team_id int
created_at timestamp
deleted_at timestamp
}
ref: game_teams.game_id > games.id
ref: game_teams.team_id > teams.id
table player_objectives {
id int
player_id int
objective_id int
game_id int
created_at timestamp
deleted_at timestamp
}
ref: player_objectives.player_id > players.id
ref: player_objectives.objective_id > objectives.id
ref: player_objectives.game_id > games.id
table standings {
id int
team_id int
player_id int
table_name text
record_id int
created_at timestamp
deleted_at timestamp
}
ref: standings.team_id > teams.id
ref: standings.player_id > players.id
table tags {
id int
name text
table_name text
record_id int
created_at timestamp
deleted_at timestamp
}
table posts {
id int
title text
body text
user_id int
status text
published_at timestamp
created_at timestamp
deleted_at timestamp
}
ref: posts.user_id > users.id
table comments {
id int
body text
user_id int
post_id int
created_at timestamp
deleted_at timestamp
}
ref: comments.user_id > users.id
ref: comments.post_id > posts.id
table logs {
id int
message text
user_id int
table_name text
record_id int
created_at timestamp
deleted_at timestamp
}