text: -- phpMyAdmin SQL Dump
  -- version 4.8.5
  -- https://www.phpmyadmin.net/
  --
  -- Host: localhost
  -- Generation Time: Dec 07, 2020 at 09:33 PM
  -- Server version: 5.7.32-0ubuntu0.16.04.1
  -- PHP Version: 7.0.33-0ubuntu0.16.04.16
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET AUTOCOMMIT = 0;
  START TRANSACTION;
  SET time_zone = "+00:00";
  
  
  /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  /*!40101 SET NAMES utf8mb4 */;
  
  --
  -- Database: `perehvat`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `admins`
  --
  
  CREATE TABLE `admins` (
    `id` int(11) NOT NULL,
    `user_id` varchar(50) NOT NULL,
    `game` varchar(50) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  
  --
  -- Table structure for table `blocked`
  --
  
  CREATE TABLE `blocked` (
    `id` int(11) NOT NULL,
    `user_id` varchar(36) CHARACTER SET utf8 NOT NULL,
    `game` varchar(50) CHARACTER SET utf8 NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Table structure for table `districts`
  --
  
  CREATE TABLE `districts` (
    `id` int(11) NOT NULL,
    `district` varchar(20) CHARACTER SET utf8 NOT NULL,
    `game` varchar(50) CHARACTER SET utf8 NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  
  --
  -- Table structure for table `games`
  --
  
  CREATE TABLE `games` (
    `id` int(11) NOT NULL,
    `name` varchar(50) CHARACTER SET utf8 NOT NULL,
    `creator` varchar(50) NOT NULL,
    `game_time` int(2) NOT NULL DEFAULT '50',
    `waiting_time` int(2) NOT NULL DEFAULT '10',
    `start_time` int(11) NOT NULL DEFAULT '0',
    `end_game` tinyint(1) NOT NULL DEFAULT '1',
    `radius` bigint(20) NOT NULL DEFAULT '2000000',
    `game_type` int(11) NOT NULL DEFAULT '0'
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  
  --
  -- Table structure for table `markers`
  --
  
  CREATE TABLE `markers` (
    `id` varchar(36) NOT NULL,
    `user_name` text CHARACTER SET utf8mb4 NOT NULL,
    `color` text NOT NULL,
    `geolocation_lat` double NOT NULL,
    `geolocation_lng` double NOT NULL,
    `last_activity` datetime NOT NULL,
    `speed` double NOT NULL,  
    `accuracy` double NOT NULL,
    `game` varchar(50) CHARACTER SET utf8 NOT NULL,
    `is_prey` tinyint(1) NOT NULL DEFAULT '0',
    `blocked` int(11) NOT NULL DEFAULT '0'
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Table structure for table `tracks`
  --
  
  CREATE TABLE `tracks` (
    `id` int(11) NOT NULL,
    `marker_id` varchar(36) NOT NULL,
    `user_name` text CHARACTER SET utf8mb4 NOT NULL,
    `color` text NOT NULL,
    `geolocation_lat` double NOT NULL,
    `geolocation_lng` double NOT NULL,
    `last_activity` datetime NOT NULL,
    `speed` double NOT NULL,
    `accuracy` double NOT NULL,
    `game` varchar(50) CHARACTER SET utf8 NOT NULL,
    `is_prey` tinyint(1) NOT NULL DEFAULT '0'
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `tracks`
  --
  ALTER TABLE `tracks`
    ADD PRIMARY KEY (`id`),
    ADD KEY `game` (`game`),
    ADD KEY `game_last_activity` (`game`,`last_activity`),
    ADD KEY `history` (`marker_id`,`last_activity`,`game`) USING BTREE;
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `tracks`
  --
  ALTER TABLE `tracks`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  COMMIT;
  
  --
  -- Table structure for table `users`
  --
  
  CREATE TABLE `users` (
    `id` varchar(50) NOT NULL,
    `password` varchar(50) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `admins`
  --
  ALTER TABLE `admins`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `blocked`
  --
  ALTER TABLE `blocked`
    ADD PRIMARY KEY (`id`),
    ADD KEY `user_id` (`user_id`) USING BTREE;
  
  --
  -- Indexes for table `districts`
  --
  ALTER TABLE `districts`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `games`
  --
  ALTER TABLE `games`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `markers`
  --
  ALTER TABLE `markers`
    ADD PRIMARY KEY (`id`),
    ADD KEY `game` (`game`);
  
  --
  -- Indexes for table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `admins`
  --
  ALTER TABLE `admins`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
  
  --
  -- AUTO_INCREMENT for table `blocked`
  --
  ALTER TABLE `blocked`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
  
  --
  -- AUTO_INCREMENT for table `districts`
  --
  ALTER TABLE `districts`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
  
  --
  -- AUTO_INCREMENT for table `games`
  --
  ALTER TABLE `games`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
  
  
  /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  