· 10 years ago · Aug 24, 2016, 07:46 PM
1-- phpMyAdmin SQL Dump
2-- version 4.0.10deb1
3-- http://www.phpmyadmin.net
4--
5-- Vært: localhost
6-- Genereringstid: 24. 08 2016 kl. 15:45:33
7-- Serverversion: 5.5.50-0ubuntu0.14.04.1
8-- PHP-version: 5.5.9-1ubuntu4.19
9
10SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11SET time_zone = "+00:00";
12
13
14/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
15/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
16/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
17/*!40101 SET NAMES utf8 */;
18
19--
20-- Database: `ebot`
21--
22
23-- --------------------------------------------------------
24
25--
26-- Struktur-dump for tabellen `advertising`
27--
28
29CREATE TABLE IF NOT EXISTS `advertising` (
30 `id` bigint(20) NOT NULL AUTO_INCREMENT,
31 `season_id` bigint(20) DEFAULT NULL,
32 `message` text,
33 `active` tinyint(1) DEFAULT NULL,
34 `created_at` datetime NOT NULL,
35 `updated_at` datetime NOT NULL,
36 PRIMARY KEY (`id`),
37 KEY `season_id_idx` (`season_id`)
38) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
39
40-- --------------------------------------------------------
41
42--
43-- Struktur-dump for tabellen `configs`
44--
45
46CREATE TABLE IF NOT EXISTS `configs` (
47 `id` bigint(20) NOT NULL AUTO_INCREMENT,
48 `name` varchar(50) DEFAULT NULL,
49 `description` varchar(255) DEFAULT NULL,
50 `content` text,
51 `created_at` datetime NOT NULL,
52 `updated_at` datetime NOT NULL,
53 PRIMARY KEY (`id`)
54) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
55
56-- --------------------------------------------------------
57
58--
59-- Struktur-dump for tabellen `maps`
60--
61
62CREATE TABLE IF NOT EXISTS `maps` (
63 `id` bigint(20) NOT NULL AUTO_INCREMENT,
64 `match_id` bigint(20) NOT NULL,
65 `map_name` varchar(50) DEFAULT NULL,
66 `score_1` bigint(20) DEFAULT NULL,
67 `score_2` bigint(20) DEFAULT NULL,
68 `current_side` varchar(255) DEFAULT NULL,
69 `status` mediumint(9) DEFAULT NULL,
70 `maps_for` varchar(255) DEFAULT NULL,
71 `nb_ot` bigint(20) DEFAULT NULL,
72 `identifier_id` bigint(20) DEFAULT NULL,
73 `tv_record_file` varchar(255) DEFAULT NULL,
74 `created_at` datetime NOT NULL,
75 `updated_at` datetime NOT NULL,
76 PRIMARY KEY (`id`),
77 KEY `match_id_idx` (`match_id`)
78) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=394 ;
79
80-- --------------------------------------------------------
81
82--
83-- Struktur-dump for tabellen `maps_score`
84--
85
86CREATE TABLE IF NOT EXISTS `maps_score` (
87 `id` bigint(20) NOT NULL AUTO_INCREMENT,
88 `map_id` bigint(20) NOT NULL,
89 `type_score` varchar(255) DEFAULT NULL,
90 `score1_side1` bigint(20) DEFAULT NULL,
91 `score1_side2` bigint(20) DEFAULT NULL,
92 `score2_side1` bigint(20) DEFAULT NULL,
93 `score2_side2` bigint(20) DEFAULT NULL,
94 `created_at` datetime NOT NULL,
95 `updated_at` datetime NOT NULL,
96 PRIMARY KEY (`id`),
97 KEY `map_id_idx` (`map_id`)
98) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=412 ;
99
100-- --------------------------------------------------------
101
102--
103-- Struktur-dump for tabellen `matchs`
104--
105
106CREATE TABLE IF NOT EXISTS `matchs` (
107 `id` bigint(20) NOT NULL AUTO_INCREMENT,
108 `ip` varchar(50) DEFAULT NULL,
109 `server_id` bigint(20) DEFAULT NULL,
110 `season_id` bigint(20) DEFAULT NULL,
111 `team_a` bigint(20) DEFAULT NULL,
112 `team_a_flag` varchar(2) DEFAULT NULL,
113 `team_a_name` varchar(25) DEFAULT NULL,
114 `team_b` bigint(20) DEFAULT NULL,
115 `team_b_flag` varchar(2) DEFAULT NULL,
116 `team_b_name` varchar(25) DEFAULT NULL,
117 `status` smallint(6) DEFAULT NULL,
118 `is_paused` tinyint(1) DEFAULT NULL,
119 `score_a` bigint(20) DEFAULT NULL,
120 `score_b` bigint(20) DEFAULT NULL,
121 `max_round` mediumint(9) NOT NULL,
122 `rules` varchar(200) NOT NULL,
123 `overtime_startmoney` bigint(20) DEFAULT NULL,
124 `overtime_max_round` mediumint(9) DEFAULT NULL,
125 `config_full_score` tinyint(1) DEFAULT NULL,
126 `config_ot` tinyint(1) DEFAULT NULL,
127 `config_streamer` tinyint(1) DEFAULT NULL,
128 `config_knife_round` tinyint(1) DEFAULT NULL,
129 `config_switch_auto` tinyint(1) DEFAULT NULL,
130 `config_auto_change_password` tinyint(1) DEFAULT NULL,
131 `config_password` varchar(50) DEFAULT NULL,
132 `config_heatmap` tinyint(1) DEFAULT NULL,
133 `config_authkey` varchar(200) DEFAULT NULL,
134 `enable` tinyint(1) DEFAULT NULL,
135 `map_selection_mode` varchar(255) DEFAULT NULL,
136 `ingame_enable` tinyint(1) DEFAULT NULL,
137 `current_map` bigint(20) DEFAULT NULL,
138 `force_zoom_match` tinyint(1) DEFAULT NULL,
139 `identifier_id` bigint(20) DEFAULT NULL,
140 `startdate` datetime DEFAULT NULL,
141 `auto_start` tinyint(1) DEFAULT NULL,
142 `auto_start_time` mediumint(9) DEFAULT NULL,
143 `created_at` datetime NOT NULL,
144 `updated_at` datetime NOT NULL,
145 PRIMARY KEY (`id`),
146 KEY `server_id_idx` (`server_id`),
147 KEY `team_a_idx` (`team_a`),
148 KEY `team_b_idx` (`team_b`),
149 KEY `current_map_idx` (`current_map`),
150 KEY `season_id_idx` (`season_id`)
151) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=394 ;
152
153-- --------------------------------------------------------
154
155--
156-- Struktur-dump for tabellen `players`
157--
158
159CREATE TABLE IF NOT EXISTS `players` (
160 `id` bigint(20) NOT NULL AUTO_INCREMENT,
161 `match_id` bigint(20) NOT NULL,
162 `map_id` bigint(20) NOT NULL,
163 `player_key` varchar(255) DEFAULT NULL,
164 `team` varchar(255) DEFAULT 'other',
165 `ip` varchar(255) DEFAULT NULL,
166 `steamid` varchar(255) DEFAULT NULL,
167 `first_side` varchar(255) DEFAULT NULL,
168 `current_side` varchar(255) DEFAULT NULL,
169 `pseudo` varchar(255) DEFAULT NULL,
170 `nb_kill` bigint(20) DEFAULT '0',
171 `assist` bigint(20) DEFAULT '0',
172 `death` bigint(20) DEFAULT '0',
173 `point` bigint(20) DEFAULT '0',
174 `hs` bigint(20) DEFAULT '0',
175 `defuse` bigint(20) DEFAULT '0',
176 `bombe` bigint(20) DEFAULT '0',
177 `tk` bigint(20) DEFAULT '0',
178 `nb1` bigint(20) DEFAULT '0',
179 `nb2` bigint(20) DEFAULT '0',
180 `nb3` bigint(20) DEFAULT '0',
181 `nb4` bigint(20) DEFAULT '0',
182 `nb5` bigint(20) DEFAULT '0',
183 `nb1kill` bigint(20) DEFAULT '0',
184 `nb2kill` bigint(20) DEFAULT '0',
185 `nb3kill` bigint(20) DEFAULT '0',
186 `nb4kill` bigint(20) DEFAULT '0',
187 `nb5kill` bigint(20) DEFAULT '0',
188 `pluskill` bigint(20) DEFAULT '0',
189 `firstkill` bigint(20) DEFAULT '0',
190 `created_at` datetime NOT NULL,
191 `updated_at` datetime NOT NULL,
192 PRIMARY KEY (`id`),
193 KEY `match_id_idx` (`match_id`),
194 KEY `map_id_idx` (`map_id`)
195) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6972 ;
196
197-- --------------------------------------------------------
198
199--
200-- Struktur-dump for tabellen `players_heatmap`
201--
202
203CREATE TABLE IF NOT EXISTS `players_heatmap` (
204 `id` bigint(20) NOT NULL AUTO_INCREMENT,
205 `match_id` bigint(20) NOT NULL,
206 `map_id` bigint(20) NOT NULL,
207 `event_name` varchar(50) DEFAULT NULL,
208 `event_x` double(18,2) DEFAULT NULL,
209 `event_y` double(18,2) DEFAULT NULL,
210 `event_z` double(18,2) DEFAULT NULL,
211 `player_name` varchar(255) DEFAULT NULL,
212 `player_id` bigint(20) DEFAULT NULL,
213 `player_team` varchar(20) DEFAULT NULL,
214 `attacker_x` double(18,2) DEFAULT NULL,
215 `attacker_y` double(18,2) DEFAULT NULL,
216 `attacker_z` double(18,2) DEFAULT NULL,
217 `attacker_name` varchar(255) DEFAULT NULL,
218 `attacker_id` bigint(20) DEFAULT NULL,
219 `attacker_team` varchar(20) DEFAULT NULL,
220 `round_id` bigint(20) DEFAULT NULL,
221 `round_time` bigint(20) DEFAULT NULL,
222 `created_at` datetime NOT NULL,
223 `updated_at` datetime NOT NULL,
224 PRIMARY KEY (`id`),
225 KEY `match_id_idx` (`match_id`),
226 KEY `map_id_idx` (`map_id`),
227 KEY `player_id_idx` (`player_id`),
228 KEY `attacker_id_idx` (`attacker_id`)
229) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=168383 ;
230
231-- --------------------------------------------------------
232
233--
234-- Struktur-dump for tabellen `players_snapshot`
235--
236
237CREATE TABLE IF NOT EXISTS `players_snapshot` (
238 `id` bigint(20) NOT NULL AUTO_INCREMENT,
239 `player_id` bigint(20) NOT NULL,
240 `player_key` varchar(255) DEFAULT NULL,
241 `first_side` varchar(255) DEFAULT NULL,
242 `current_side` varchar(255) DEFAULT NULL,
243 `nb_kill` bigint(20) DEFAULT '0',
244 `assist` bigint(20) DEFAULT '0',
245 `death` bigint(20) DEFAULT '0',
246 `point` bigint(20) DEFAULT '0',
247 `hs` bigint(20) DEFAULT '0',
248 `defuse` bigint(20) DEFAULT '0',
249 `bombe` bigint(20) DEFAULT '0',
250 `tk` bigint(20) DEFAULT '0',
251 `nb1` bigint(20) DEFAULT '0',
252 `nb2` bigint(20) DEFAULT '0',
253 `nb3` bigint(20) DEFAULT '0',
254 `nb4` bigint(20) DEFAULT '0',
255 `nb5` bigint(20) DEFAULT '0',
256 `nb1kill` bigint(20) DEFAULT '0',
257 `nb2kill` bigint(20) DEFAULT '0',
258 `nb3kill` bigint(20) DEFAULT '0',
259 `nb4kill` bigint(20) DEFAULT '0',
260 `nb5kill` bigint(20) DEFAULT '0',
261 `pluskill` bigint(20) DEFAULT '0',
262 `firstkill` bigint(20) DEFAULT '0',
263 `round_id` bigint(20) DEFAULT NULL,
264 `created_at` datetime NOT NULL,
265 `updated_at` datetime NOT NULL,
266 PRIMARY KEY (`id`),
267 KEY `player_id_idx` (`player_id`)
268) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=319711 ;
269
270-- --------------------------------------------------------
271
272--
273-- Struktur-dump for tabellen `player_kill`
274--
275
276CREATE TABLE IF NOT EXISTS `player_kill` (
277 `id` bigint(20) NOT NULL AUTO_INCREMENT,
278 `match_id` bigint(20) NOT NULL,
279 `map_id` bigint(20) NOT NULL,
280 `killer_name` varchar(100) DEFAULT NULL,
281 `killer_id` bigint(20) DEFAULT NULL,
282 `killer_team` varchar(20) DEFAULT NULL,
283 `killed_name` varchar(100) DEFAULT NULL,
284 `killed_id` bigint(20) DEFAULT NULL,
285 `killed_team` varchar(20) DEFAULT NULL,
286 `weapon` varchar(100) DEFAULT NULL,
287 `headshot` tinyint(1) DEFAULT NULL,
288 `round_id` bigint(20) DEFAULT NULL,
289 `created_at` datetime NOT NULL,
290 `updated_at` datetime NOT NULL,
291 PRIMARY KEY (`id`),
292 KEY `match_id_idx` (`match_id`),
293 KEY `map_id_idx` (`map_id`),
294 KEY `killer_id_idx` (`killer_id`),
295 KEY `killed_id_idx` (`killed_id`)
296) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=51749 ;
297
298-- --------------------------------------------------------
299
300--
301-- Struktur-dump for tabellen `round`
302--
303
304CREATE TABLE IF NOT EXISTS `round` (
305 `id` bigint(20) NOT NULL AUTO_INCREMENT,
306 `match_id` bigint(20) NOT NULL,
307 `map_id` bigint(20) NOT NULL,
308 `event_name` varchar(255) DEFAULT NULL,
309 `event_text` text,
310 `event_time` bigint(20) DEFAULT NULL,
311 `kill_id` bigint(20) DEFAULT NULL,
312 `round_id` bigint(20) DEFAULT NULL,
313 `created_at` datetime NOT NULL,
314 `updated_at` datetime NOT NULL,
315 PRIMARY KEY (`id`),
316 KEY `match_id_idx` (`match_id`),
317 KEY `map_id_idx` (`map_id`),
318 KEY `kill_id_idx` (`kill_id`)
319) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=356347 ;
320
321-- --------------------------------------------------------
322
323--
324-- Struktur-dump for tabellen `round_summary`
325--
326
327CREATE TABLE IF NOT EXISTS `round_summary` (
328 `id` bigint(20) NOT NULL AUTO_INCREMENT,
329 `match_id` bigint(20) NOT NULL,
330 `map_id` bigint(20) NOT NULL,
331 `bomb_planted` tinyint(1) DEFAULT NULL,
332 `bomb_defused` tinyint(1) DEFAULT NULL,
333 `bomb_exploded` tinyint(1) DEFAULT NULL,
334 `win_type` varchar(255) DEFAULT 'normal',
335 `team_win` varchar(255) DEFAULT NULL,
336 `ct_win` tinyint(1) DEFAULT NULL,
337 `t_win` tinyint(1) DEFAULT NULL,
338 `score_a` smallint(6) DEFAULT NULL,
339 `score_b` smallint(6) DEFAULT NULL,
340 `best_killer` bigint(20) DEFAULT NULL,
341 `best_killer_nb` bigint(20) DEFAULT NULL,
342 `best_killer_fk` tinyint(1) DEFAULT NULL,
343 `best_action_type` text,
344 `best_action_param` text,
345 `backup_file_name` varchar(255) DEFAULT NULL,
346 `round_id` bigint(20) DEFAULT NULL,
347 `created_at` datetime NOT NULL,
348 `updated_at` datetime NOT NULL,
349 PRIMARY KEY (`id`),
350 KEY `match_id_idx` (`match_id`),
351 KEY `map_id_idx` (`map_id`),
352 KEY `best_killer_idx` (`best_killer`)
353) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7480 ;
354
355-- --------------------------------------------------------
356
357--
358-- Struktur-dump for tabellen `seasons`
359--
360
361CREATE TABLE IF NOT EXISTS `seasons` (
362 `id` bigint(20) NOT NULL AUTO_INCREMENT,
363 `name` varchar(50) NOT NULL,
364 `event` varchar(50) NOT NULL,
365 `start` datetime NOT NULL,
366 `end` datetime NOT NULL,
367 `link` varchar(100) DEFAULT NULL,
368 `logo` varchar(255) DEFAULT NULL,
369 `active` tinyint(1) DEFAULT NULL,
370 `created_at` datetime NOT NULL,
371 `updated_at` datetime NOT NULL,
372 PRIMARY KEY (`id`)
373) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
374
375-- --------------------------------------------------------
376
377--
378-- Struktur-dump for tabellen `servers`
379--
380
381CREATE TABLE IF NOT EXISTS `servers` (
382 `id` bigint(20) NOT NULL AUTO_INCREMENT,
383 `ip` varchar(50) NOT NULL,
384 `rcon` varchar(50) NOT NULL,
385 `hostname` varchar(100) NOT NULL,
386 `tv_ip` varchar(100) DEFAULT NULL,
387 `created_at` datetime NOT NULL,
388 `updated_at` datetime NOT NULL,
389 PRIMARY KEY (`id`)
390) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;
391
392-- --------------------------------------------------------
393
394--
395-- Struktur-dump for tabellen `sf_guard_forgot_password`
396--
397
398CREATE TABLE IF NOT EXISTS `sf_guard_forgot_password` (
399 `id` bigint(20) NOT NULL AUTO_INCREMENT,
400 `user_id` bigint(20) NOT NULL,
401 `unique_key` varchar(255) DEFAULT NULL,
402 `expires_at` datetime NOT NULL,
403 `created_at` datetime NOT NULL,
404 `updated_at` datetime NOT NULL,
405 PRIMARY KEY (`id`),
406 KEY `user_id_idx` (`user_id`)
407) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
408
409-- --------------------------------------------------------
410
411--
412-- Struktur-dump for tabellen `sf_guard_group`
413--
414
415CREATE TABLE IF NOT EXISTS `sf_guard_group` (
416 `id` bigint(20) NOT NULL AUTO_INCREMENT,
417 `name` varchar(255) DEFAULT NULL,
418 `description` text,
419 `created_at` datetime NOT NULL,
420 `updated_at` datetime NOT NULL,
421 PRIMARY KEY (`id`),
422 UNIQUE KEY `name` (`name`)
423) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
424
425-- --------------------------------------------------------
426
427--
428-- Struktur-dump for tabellen `sf_guard_group_permission`
429--
430
431CREATE TABLE IF NOT EXISTS `sf_guard_group_permission` (
432 `group_id` bigint(20) NOT NULL DEFAULT '0',
433 `permission_id` bigint(20) NOT NULL DEFAULT '0',
434 `created_at` datetime NOT NULL,
435 `updated_at` datetime NOT NULL,
436 PRIMARY KEY (`group_id`,`permission_id`),
437 KEY `sf_guard_group_permission_permission_id_sf_guard_permission_id` (`permission_id`)
438) ENGINE=InnoDB DEFAULT CHARSET=latin1;
439
440-- --------------------------------------------------------
441
442--
443-- Struktur-dump for tabellen `sf_guard_permission`
444--
445
446CREATE TABLE IF NOT EXISTS `sf_guard_permission` (
447 `id` bigint(20) NOT NULL AUTO_INCREMENT,
448 `name` varchar(255) DEFAULT NULL,
449 `description` text,
450 `created_at` datetime NOT NULL,
451 `updated_at` datetime NOT NULL,
452 PRIMARY KEY (`id`),
453 UNIQUE KEY `name` (`name`)
454) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
455
456-- --------------------------------------------------------
457
458--
459-- Struktur-dump for tabellen `sf_guard_remember_key`
460--
461
462CREATE TABLE IF NOT EXISTS `sf_guard_remember_key` (
463 `id` bigint(20) NOT NULL AUTO_INCREMENT,
464 `user_id` bigint(20) DEFAULT NULL,
465 `remember_key` varchar(32) DEFAULT NULL,
466 `ip_address` varchar(50) DEFAULT NULL,
467 `created_at` datetime NOT NULL,
468 `updated_at` datetime NOT NULL,
469 PRIMARY KEY (`id`),
470 KEY `user_id_idx` (`user_id`)
471) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=23 ;
472
473-- --------------------------------------------------------
474
475--
476-- Struktur-dump for tabellen `sf_guard_user`
477--
478
479CREATE TABLE IF NOT EXISTS `sf_guard_user` (
480 `id` bigint(20) NOT NULL AUTO_INCREMENT,
481 `first_name` varchar(255) DEFAULT NULL,
482 `last_name` varchar(255) DEFAULT NULL,
483 `email_address` varchar(255) NOT NULL,
484 `username` varchar(128) NOT NULL,
485 `algorithm` varchar(128) NOT NULL DEFAULT 'sha1',
486 `salt` varchar(128) DEFAULT NULL,
487 `password` varchar(128) DEFAULT NULL,
488 `is_active` tinyint(1) DEFAULT '1',
489 `is_super_admin` tinyint(1) DEFAULT '0',
490 `last_login` datetime DEFAULT NULL,
491 `created_at` datetime NOT NULL,
492 `updated_at` datetime NOT NULL,
493 PRIMARY KEY (`id`),
494 UNIQUE KEY `email_address` (`email_address`),
495 UNIQUE KEY `username` (`username`),
496 KEY `is_active_idx_idx` (`is_active`)
497) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;
498
499-- --------------------------------------------------------
500
501--
502-- Struktur-dump for tabellen `sf_guard_user_group`
503--
504
505CREATE TABLE IF NOT EXISTS `sf_guard_user_group` (
506 `user_id` bigint(20) NOT NULL DEFAULT '0',
507 `group_id` bigint(20) NOT NULL DEFAULT '0',
508 `created_at` datetime NOT NULL,
509 `updated_at` datetime NOT NULL,
510 PRIMARY KEY (`user_id`,`group_id`),
511 KEY `sf_guard_user_group_group_id_sf_guard_group_id` (`group_id`)
512) ENGINE=InnoDB DEFAULT CHARSET=latin1;
513
514-- --------------------------------------------------------
515
516--
517-- Struktur-dump for tabellen `sf_guard_user_permission`
518--
519
520CREATE TABLE IF NOT EXISTS `sf_guard_user_permission` (
521 `user_id` bigint(20) NOT NULL DEFAULT '0',
522 `permission_id` bigint(20) NOT NULL DEFAULT '0',
523 `created_at` datetime NOT NULL,
524 `updated_at` datetime NOT NULL,
525 PRIMARY KEY (`user_id`,`permission_id`),
526 KEY `sf_guard_user_permission_permission_id_sf_guard_permission_id` (`permission_id`)
527) ENGINE=InnoDB DEFAULT CHARSET=latin1;
528
529-- --------------------------------------------------------
530
531--
532-- Struktur-dump for tabellen `teams`
533--
534
535CREATE TABLE IF NOT EXISTS `teams` (
536 `id` bigint(20) NOT NULL AUTO_INCREMENT,
537 `name` varchar(50) NOT NULL,
538 `shorthandle` varchar(50) NOT NULL,
539 `flag` varchar(2) NOT NULL,
540 `link` varchar(100) DEFAULT NULL,
541 `created_at` datetime NOT NULL,
542 `updated_at` datetime NOT NULL,
543 PRIMARY KEY (`id`)
544) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=37 ;
545
546-- --------------------------------------------------------
547
548--
549-- Struktur-dump for tabellen `teams_in_seasons`
550--
551
552CREATE TABLE IF NOT EXISTS `teams_in_seasons` (
553 `id` bigint(20) NOT NULL AUTO_INCREMENT,
554 `season_id` bigint(20) DEFAULT NULL,
555 `team_id` bigint(20) DEFAULT NULL,
556 `created_at` datetime NOT NULL,
557 `updated_at` datetime NOT NULL,
558 PRIMARY KEY (`id`),
559 KEY `season_id_idx` (`season_id`),
560 KEY `team_id_idx` (`team_id`)
561) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ;
562
563--
564-- Begrænsninger for dumpede tabeller
565--
566
567--
568-- Begrænsninger for tabel `advertising`
569--
570ALTER TABLE `advertising`
571 ADD CONSTRAINT `advertising_season_id_seasons_id` FOREIGN KEY (`season_id`) REFERENCES `seasons` (`id`) ON DELETE CASCADE;
572
573--
574-- Begrænsninger for tabel `maps`
575--
576ALTER TABLE `maps`
577 ADD CONSTRAINT `maps_match_id_matchs_id` FOREIGN KEY (`match_id`) REFERENCES `matchs` (`id`) ON DELETE CASCADE;
578
579--
580-- Begrænsninger for tabel `maps_score`
581--
582ALTER TABLE `maps_score`
583 ADD CONSTRAINT `maps_score_map_id_maps_id` FOREIGN KEY (`map_id`) REFERENCES `maps` (`id`) ON DELETE CASCADE;
584
585--
586-- Begrænsninger for tabel `matchs`
587--
588ALTER TABLE `matchs`
589 ADD CONSTRAINT `matchs_current_map_maps_id` FOREIGN KEY (`current_map`) REFERENCES `maps` (`id`) ON DELETE CASCADE,
590 ADD CONSTRAINT `matchs_season_id_seasons_id` FOREIGN KEY (`season_id`) REFERENCES `seasons` (`id`) ON DELETE SET NULL,
591 ADD CONSTRAINT `matchs_server_id_servers_id` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE SET NULL,
592 ADD CONSTRAINT `matchs_team_a_teams_id` FOREIGN KEY (`team_a`) REFERENCES `teams` (`id`) ON DELETE SET NULL,
593 ADD CONSTRAINT `matchs_team_b_teams_id` FOREIGN KEY (`team_b`) REFERENCES `teams` (`id`) ON DELETE SET NULL;
594
595--
596-- Begrænsninger for tabel `players`
597--
598ALTER TABLE `players`
599 ADD CONSTRAINT `players_map_id_maps_id` FOREIGN KEY (`map_id`) REFERENCES `maps` (`id`) ON DELETE CASCADE,
600 ADD CONSTRAINT `players_match_id_matchs_id` FOREIGN KEY (`match_id`) REFERENCES `matchs` (`id`) ON DELETE CASCADE;
601
602--
603-- Begrænsninger for tabel `players_heatmap`
604--
605ALTER TABLE `players_heatmap`
606 ADD CONSTRAINT `players_heatmap_attacker_id_players_id` FOREIGN KEY (`attacker_id`) REFERENCES `players` (`id`) ON DELETE SET NULL,
607 ADD CONSTRAINT `players_heatmap_map_id_maps_id` FOREIGN KEY (`map_id`) REFERENCES `maps` (`id`) ON DELETE CASCADE,
608 ADD CONSTRAINT `players_heatmap_match_id_matchs_id` FOREIGN KEY (`match_id`) REFERENCES `matchs` (`id`) ON DELETE CASCADE,
609 ADD CONSTRAINT `players_heatmap_player_id_players_id` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
610
611--
612-- Begrænsninger for tabel `players_snapshot`
613--
614ALTER TABLE `players_snapshot`
615 ADD CONSTRAINT `players_snapshot_player_id_players_id` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
616
617--
618-- Begrænsninger for tabel `player_kill`
619--
620ALTER TABLE `player_kill`
621 ADD CONSTRAINT `player_kill_killed_id_players_id` FOREIGN KEY (`killed_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
622 ADD CONSTRAINT `player_kill_killer_id_players_id` FOREIGN KEY (`killer_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
623 ADD CONSTRAINT `player_kill_map_id_maps_id` FOREIGN KEY (`map_id`) REFERENCES `maps` (`id`) ON DELETE CASCADE,
624 ADD CONSTRAINT `player_kill_match_id_matchs_id` FOREIGN KEY (`match_id`) REFERENCES `matchs` (`id`) ON DELETE CASCADE;
625
626--
627-- Begrænsninger for tabel `round`
628--
629ALTER TABLE `round`
630 ADD CONSTRAINT `round_kill_id_player_kill_id` FOREIGN KEY (`kill_id`) REFERENCES `player_kill` (`id`) ON DELETE SET NULL,
631 ADD CONSTRAINT `round_map_id_maps_id` FOREIGN KEY (`map_id`) REFERENCES `maps` (`id`) ON DELETE CASCADE,
632 ADD CONSTRAINT `round_match_id_matchs_id` FOREIGN KEY (`match_id`) REFERENCES `matchs` (`id`) ON DELETE CASCADE;
633
634--
635-- Begrænsninger for tabel `round_summary`
636--
637ALTER TABLE `round_summary`
638 ADD CONSTRAINT `round_summary_best_killer_players_id` FOREIGN KEY (`best_killer`) REFERENCES `players` (`id`) ON DELETE SET NULL,
639 ADD CONSTRAINT `round_summary_map_id_maps_id` FOREIGN KEY (`map_id`) REFERENCES `maps` (`id`) ON DELETE CASCADE,
640 ADD CONSTRAINT `round_summary_match_id_matchs_id` FOREIGN KEY (`match_id`) REFERENCES `matchs` (`id`) ON DELETE CASCADE;
641
642--
643-- Begrænsninger for tabel `sf_guard_forgot_password`
644--
645ALTER TABLE `sf_guard_forgot_password`
646 ADD CONSTRAINT `sf_guard_forgot_password_user_id_sf_guard_user_id` FOREIGN KEY (`user_id`) REFERENCES `sf_guard_user` (`id`) ON DELETE CASCADE;
647
648--
649-- Begrænsninger for tabel `sf_guard_group_permission`
650--
651ALTER TABLE `sf_guard_group_permission`
652 ADD CONSTRAINT `sf_guard_group_permission_group_id_sf_guard_group_id` FOREIGN KEY (`group_id`) REFERENCES `sf_guard_group` (`id`) ON DELETE CASCADE,
653 ADD CONSTRAINT `sf_guard_group_permission_permission_id_sf_guard_permission_id` FOREIGN KEY (`permission_id`) REFERENCES `sf_guard_permission` (`id`) ON DELETE CASCADE;
654
655--
656-- Begrænsninger for tabel `sf_guard_remember_key`
657--
658ALTER TABLE `sf_guard_remember_key`
659 ADD CONSTRAINT `sf_guard_remember_key_user_id_sf_guard_user_id` FOREIGN KEY (`user_id`) REFERENCES `sf_guard_user` (`id`) ON DELETE CASCADE;
660
661--
662-- Begrænsninger for tabel `sf_guard_user_group`
663--
664ALTER TABLE `sf_guard_user_group`
665 ADD CONSTRAINT `sf_guard_user_group_group_id_sf_guard_group_id` FOREIGN KEY (`group_id`) REFERENCES `sf_guard_group` (`id`) ON DELETE CASCADE,
666 ADD CONSTRAINT `sf_guard_user_group_user_id_sf_guard_user_id` FOREIGN KEY (`user_id`) REFERENCES `sf_guard_user` (`id`) ON DELETE CASCADE;
667
668--
669-- Begrænsninger for tabel `sf_guard_user_permission`
670--
671ALTER TABLE `sf_guard_user_permission`
672 ADD CONSTRAINT `sf_guard_user_permission_permission_id_sf_guard_permission_id` FOREIGN KEY (`permission_id`) REFERENCES `sf_guard_permission` (`id`) ON DELETE CASCADE,
673 ADD CONSTRAINT `sf_guard_user_permission_user_id_sf_guard_user_id` FOREIGN KEY (`user_id`) REFERENCES `sf_guard_user` (`id`) ON DELETE CASCADE;
674
675--
676-- Begrænsninger for tabel `teams_in_seasons`
677--
678ALTER TABLE `teams_in_seasons`
679 ADD CONSTRAINT `teams_in_seasons_season_id_seasons_id` FOREIGN KEY (`season_id`) REFERENCES `seasons` (`id`) ON DELETE CASCADE,
680 ADD CONSTRAINT `teams_in_seasons_team_id_teams_id` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE;
681
682/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
683/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
684/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;