-- Wettmeister Database Structure Dump

SET character_set_client = utf8mb4;

DROP TABLE IF EXISTS `wm_users`;
CREATE TABLE `wm_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(255) NOT NULL,
  `pass` varchar(128) CHARACTER SET ascii DEFAULT NULL,
  `akey` varchar(32) CHARACTER SET ascii DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `score` int(11) DEFAULT '0',
  `exact` int(11) DEFAULT '0',
  `any` int(11) DEFAULT '0',
  `bet0` tinyint(4) DEFAULT NULL,
  `bet8` tinyint(4) DEFAULT NULL,
  `bet4` tinyint(4) DEFAULT NULL,
  `bet2` tinyint(4) DEFAULT NULL,
  `anonymous` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `wm_groups`;
CREATE TABLE `wm_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `pass` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `wm_group_assoc`;
CREATE TABLE `wm_group_assoc` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` int(11) NOT NULL,
  `group` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `wm_teams`;
CREATE TABLE `wm_teams` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `valid` tinyint(4) DEFAULT NULL,
  `name` varchar(63) NOT NULL,
  `group` char(1) DEFAULT NULL,
  `refcode` int(11) DEFAULT '0',
  `bias` tinyint(4) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `wm_locations`;
CREATE TABLE `wm_locations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `wm_stations`;
CREATE TABLE `wm_stations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `wm_matches`;
CREATE TABLE `wm_matches` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `teamA` int(11) DEFAULT NULL,
  `teamB` int(11) DEFAULT NULL,
  `goalsA` int(11) DEFAULT NULL,
  `goalsB` int(11) DEFAULT NULL,
  `time` datetime DEFAULT NULL,
  `location` int(11) DEFAULT NULL,
  `station` int(11) DEFAULT NULL,
  `class` int(11) DEFAULT NULL,
  `number` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `wm_bets`;
CREATE TABLE `wm_bets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` int(11) DEFAULT NULL,
  `match` int(11) DEFAULT NULL,
  `goalsA` int(11) DEFAULT NULL,
  `goalsB` int(11) DEFAULT NULL,
  `cast` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `wm_survey`;
CREATE TABLE `wm_survey` (
  `uid` int(11) NOT NULL,
  `score_exact` int(11) DEFAULT NULL,
  `score_diff` int(11) DEFAULT NULL,
  `score_win` int(11) DEFAULT NULL,
  `score_even` int(11) DEFAULT NULL,
  `with11` int(11) DEFAULT NULL,
  `bonus0em` int(11) DEFAULT NULL,
  `bonus4em` int(11) DEFAULT NULL,
  `bonus2em` int(11) DEFAULT NULL,
  `bonus0wm` int(11) DEFAULT NULL,
  `bonus8wm` int(11) DEFAULT NULL,
  `bonus4wm` int(11) DEFAULT NULL,
  `bonus2wm` int(11) DEFAULT NULL,
  `comment` text,
  `cast` datetime DEFAULT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `wm_log`;
CREATE TABLE `wm_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` int(11) DEFAULT NULL,
  `time` datetime DEFAULT NULL,
  `host` varchar(255) DEFAULT NULL,
  `agent` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;

-- END of Wettmeister Database Structure Dump
