-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Время создания: Фев 26 2018 г., 09:30
-- Версия сервера: 5.5.25
-- Версия PHP: 5.3.13

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;

--
-- База данных: `koikoi`
--

-- --------------------------------------------------------

--
-- Структура таблицы `chat`
--

CREATE TABLE IF NOT EXISTS `chat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `poster` varchar(255) DEFAULT NULL,
  `posttime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `message` text NOT NULL,
  `room` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `room` (`room`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=2901 ;

--
-- Структура таблицы `events`
--

CREATE TABLE IF NOT EXISTS `events` (
  `game` int(11) NOT NULL,
  `targetp` int(11) NOT NULL,
  `stage` int(11) NOT NULL,
  `event` text,
  `round` int(11) NOT NULL,
  KEY `stage` (`stage`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Структура таблицы `games`
--

CREATE TABLE IF NOT EXISTS `games` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `pl1` int(11) NOT NULL DEFAULT '0',
  `pl2` int(11) NOT NULL DEFAULT '0',
  `round` int(11) NOT NULL DEFAULT '1',
  `gamestate` text NOT NULL,
  `score1` int(11) NOT NULL DEFAULT '0',
  `score2` int(11) NOT NULL DEFAULT '0',
  `rules` varchar(100) DEFAULT NULL,
  `start` datetime NOT NULL,
  `lastturn` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `state` int(11) NOT NULL,
  `next` int(11) NOT NULL,
  `tour` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`ID`),
  KEY `ID` (`ID`),
  KEY `pl1` (`pl1`),
  KEY `pl2` (`pl2`),
  KEY `tour` (`tour`),
  KEY `lastturn` (`lastturn`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1432 ;

--
-- Структура таблицы `players`
--

CREATE TABLE IF NOT EXISTS `players` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dispname` varchar(255) DEFAULT NULL,
  `login` varchar(255) NOT NULL DEFAULT '',
  `email` varchar(255) NOT NULL,
  `games` int(11) NOT NULL DEFAULT '0',
  `wins` int(11) NOT NULL DEFAULT '0',
  `loses` int(11) DEFAULT '0',
  `draws` int(11) DEFAULT '0',
  `drops` int(11) DEFAULT '0',
  `rating` double DEFAULT '100',
  `wr` int(11) DEFAULT '0',
  `lastseen` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `dispname` (`dispname`),
  KEY `id` (`id`),
  KEY `login` (`login`),
  KEY `rating` (`rating`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=246 ;

--
-- Дамп данных таблицы `players`
--

INSERT INTO `players` (`id`, `dispname`, `login`, `email`, `games`, `wins`, `loses`, `draws`, `drops`, `rating`, `wr`, `lastseen`) VALUES
(-1, '[BOT] Random', 'c48aba0fbf2662d2992e8e58b53598bf', '', 0, 0, 0, 0, 0, 100, 0, '0000-00-00 00:00:00');

-- --------------------------------------------------------

--
-- Структура таблицы `tours`
--

CREATE TABLE IF NOT EXISTS `tours` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `type` int(11) NOT NULL,
  `state` int(11) NOT NULL,
  `start` datetime NOT NULL,
  `rules` varchar(255) NOT NULL,
  `data` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

-- --------------------------------------------------------

--
-- Структура таблицы `waiting`
--

CREATE TABLE IF NOT EXISTS `waiting` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `player` int(11) NOT NULL,
  `rules` varchar(100) DEFAULT NULL,
  `roomname` varchar(255) NOT NULL,
  `game` int(11) NOT NULL DEFAULT '0',
  `lastseen` datetime DEFAULT NULL,
  `guests` varchar(255) NOT NULL DEFAULT '[]',
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1427 ;


/*!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 */;
