Skip to content

Commit 0740bc4

Browse files
committed
Update db-schema
1 parent b87756f commit 0740bc4

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

db_latest.sql

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,104 @@ CREATE TABLE IF NOT EXISTS `teams` (
463463
PRIMARY KEY (`id`)
464464
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
465465

466+
CREATE TABLE `broadcasters` (
467+
`match_id` bigint(20) unsigned NOT NULL,
468+
`account_id` int(10) unsigned NOT NULL,
469+
`name` varchar(255) DEFAULT NULL
470+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
471+
472+
CREATE TABLE `live_matches` (
473+
`id` bigint(20) unsigned NOT NULL,
474+
`match_id` bigint(20) unsigned NOT NULL,
475+
`duration` smallint(11) unsigned NOT NULL DEFAULT '0',
476+
`first_blood_time` smallint(11) unsigned NOT NULL DEFAULT '0',
477+
`start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
478+
`game_mode` tinyint(4) NOT NULL,
479+
`tower_status_radiant` int(11) unsigned NOT NULL DEFAULT '0',
480+
`tower_status_dire` int(11) unsigned NOT NULL DEFAULT '0',
481+
`barracks_status_radiant` int(11) unsigned NOT NULL DEFAULT '0',
482+
`barracks_status_dire` int(11) unsigned NOT NULL DEFAULT '0',
483+
`lobby_type` tinyint(6) unsigned NOT NULL DEFAULT '0',
484+
`leagueid` mediumint(4) unsigned NOT NULL DEFAULT '0',
485+
`radiant_team_id` int(11) unsigned DEFAULT NULL,
486+
`radiant_name` varchar(200) DEFAULT NULL,
487+
`radiant_logo` varchar(32) DEFAULT NULL,
488+
`radiant_team_complete` tinyint(3) unsigned DEFAULT NULL,
489+
`dire_team_id` int(11) unsigned DEFAULT NULL,
490+
`dire_name` varchar(200) DEFAULT NULL,
491+
`dire_logo` varchar(32) DEFAULT NULL,
492+
`dire_team_complete` tinyint(3) unsigned DEFAULT NULL,
493+
`radiant_captain` int(10) unsigned DEFAULT NULL,
494+
`dire_captain` int(10) unsigned DEFAULT NULL,
495+
`radiant_score` tinyint(3) unsigned DEFAULT NULL,
496+
`dire_score` int(10) unsigned DEFAULT NULL,
497+
`lobby_id` bigint(20) unsigned DEFAULT NULL,
498+
`spectators` int(10) unsigned DEFAULT NULL,
499+
`series_id` int(10) unsigned DEFAULT NULL,
500+
`game_number` tinyint(3) unsigned DEFAULT NULL,
501+
`stream_delay_s` tinyint(3) unsigned DEFAULT NULL,
502+
`radiant_series_wins` tinyint(3) unsigned DEFAULT NULL,
503+
`dire_series_wins` tinyint(3) unsigned DEFAULT NULL,
504+
`series_type` tinyint(3) unsigned DEFAULT NULL,
505+
`league_series_id` int(10) unsigned DEFAULT NULL,
506+
`league_game_id` int(10) unsigned DEFAULT NULL,
507+
`stage_name` varchar(255) DEFAULT NULL,
508+
`league_tier` tinyint(3) unsigned DEFAULT NULL,
509+
`roshan_respawn_timer` smallint(5) unsigned DEFAULT NULL
510+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
511+
512+
CREATE TABLE `live_slots` (
513+
`live_match_id` bigint(20) unsigned NOT NULL,
514+
`id` bigint(10) unsigned NOT NULL,
515+
`match_id` bigint(20) unsigned NOT NULL DEFAULT '0',
516+
`account_id` int(20) unsigned NOT NULL DEFAULT '0',
517+
`hero_id` tinyint(10) unsigned NOT NULL DEFAULT '0',
518+
`player_slot` tinyint(10) unsigned NOT NULL DEFAULT '0',
519+
`item_0` smallint(10) NOT NULL DEFAULT '0',
520+
`item_1` smallint(10) NOT NULL DEFAULT '0',
521+
`item_2` smallint(10) NOT NULL DEFAULT '0',
522+
`item_3` smallint(10) NOT NULL DEFAULT '0',
523+
`item_4` smallint(10) NOT NULL DEFAULT '0',
524+
`item_5` smallint(10) NOT NULL DEFAULT '0',
525+
`kills` tinyint(10) unsigned NOT NULL DEFAULT '0',
526+
`deaths` tinyint(10) unsigned NOT NULL DEFAULT '0',
527+
`assists` tinyint(10) unsigned NOT NULL DEFAULT '0',
528+
`gold` mediumint(10) unsigned DEFAULT '0',
529+
`last_hits` smallint(10) unsigned NOT NULL DEFAULT '0',
530+
`denies` smallint(10) unsigned NOT NULL DEFAULT '0',
531+
`gold_per_min` smallint(10) unsigned NOT NULL DEFAULT '0',
532+
`xp_per_min` smallint(10) unsigned NOT NULL DEFAULT '0',
533+
`level` tinyint(10) unsigned NOT NULL DEFAULT '0',
534+
`ultimate_state` smallint(5) unsigned NOT NULL DEFAULT '0',
535+
`ultimate_cooldown` smallint(5) unsigned NOT NULL DEFAULT '0',
536+
`respawn_timer` tinyint(3) unsigned NOT NULL DEFAULT '0',
537+
`position_x` smallint(6) DEFAULT NULL,
538+
`position_y` smallint(6) DEFAULT NULL,
539+
`net_worth` mediumint(8) unsigned NOT NULL DEFAULT '0'
540+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
541+
542+
ALTER TABLE `broadcasters`
543+
ADD UNIQUE KEY `match_id` (`match_id`,`account_id`) USING BTREE;
544+
545+
ALTER TABLE `live_matches`
546+
ADD PRIMARY KEY (`id`),
547+
ADD KEY `FK_matches_leagues` (`leagueid`),
548+
ADD KEY `FK_matches_teams` (`radiant_team_id`),
549+
ADD KEY `FK_matches_teams_2` (`dire_team_id`);
550+
551+
ALTER TABLE `live_slots`
552+
ADD PRIMARY KEY (`id`),
553+
ADD KEY `FK_slots_users` (`account_id`),
554+
ADD KEY `FK_slots_heroes` (`hero_id`),
555+
ADD KEY `FK_slots_matches` (`match_id`),
556+
ADD KEY `account_id` (`account_id`,`hero_id`),
557+
ADD KEY `live_match_id` (`live_match_id`);
558+
559+
ALTER TABLE `live_matches`
560+
MODIFY `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT;
561+
562+
ALTER TABLE `live_slots`
563+
MODIFY `id` bigint(10) unsigned NOT NULL AUTO_INCREMENT;SET FOREIGN_KEY_CHECKS=1;
466564

467565
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
468566
/*!40000 ALTER TABLE `users` ENABLE KEYS */;

0 commit comments

Comments
 (0)