X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=create_database.sql;h=dc70a0bcade3d841b173e7cfbd773ccaa45641b6;hp=4c7419177fbd98a9065cfc301669213748beb64b;hb=904257a6571c948d6501a46ea449107a60b0a4e3;hpb=3eb71d1ca10d4dc4b06ef84eaa410862ce8d7df9 diff --git a/create_database.sql b/create_database.sql index 4c74191..dc70a0b 100644 --- a/create_database.sql +++ b/create_database.sql @@ -1,3 +1,22 @@ +/* Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 Arun Persaud + * + * This file is part of e-DoKo. + * + * e-DoKo is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * e-DoKo is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with e-DoKo. If not, see . + * + */ + -- MySQL dump 10.9 -- -- Host: localhost Database: doko @@ -12,6 +31,28 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; + +-- +-- Table structure for table `Version` +-- + +DROP TABLE IF EXISTS `Version`; +CREATE TABLE `Version` ( + `version` int NOT NULL default '5' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `Card` +-- + + +/*!40000 ALTER TABLE `Card` DISABLE KEYS */; +LOCK TABLES `Version` WRITE; +INSERT INTO `Version` VALUES (2); +UNLOCK TABLES; +/*!40000 ALTER TABLE `Version` ENABLE KEYS */; + + -- -- Table structure for table `Card` -- @@ -47,6 +88,7 @@ CREATE TABLE `Comment` ( `id` int(11) NOT NULL auto_increment, `user_id` int(11) default NULL, `play_id` int(11) default NULL, + `game_id` int(11) default NULL, `comment` text, UNIQUE KEY `id` (`id`), KEY `play_id` (`play_id`) @@ -98,13 +140,14 @@ CREATE TABLE `Game` ( `type` enum('normal','solo','wedding','poverty','dpoverty') default NULL, `solo` enum('trumpless','jack','queen','trump','club','spade','heart','silent') default NULL, `sickness` int(11) default NULL, - `startplayer` tinyint(4) default '1', - `player` int(11) default NULL, - `status` enum('pre','play','gameover') default NULL, + `startplayer` tinyint(4) default '1', + `player` int(11) default NULL, + `status` enum('pre','play','gameover','cancel-timedout','cancel-nines','cancel-trump','cancel-noplay','cancel-lowtrump') default NULL, `ruleset` int(11) default NULL, `session` int(11) default NULL, `id` int(11) NOT NULL auto_increment, - UNIQUE KEY `id` (`id`) + UNIQUE KEY `id` (`id`), + KEY `session` (`session`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- @@ -129,10 +172,11 @@ CREATE TABLE `Rulesets` ( `dullen` enum('none','firstwins','secondwins') default 'secondwins', `schweinchen` enum ('none','both','second','secondaftercall') default 'second', `call` enum ('1st-own-card','5th-card','9-cards') default '1st-own-card', + `lowtrump` enum('poverty','cancel','none') default 'poverty', `id` int(11) NOT NULL auto_increment, UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; - + -- -- Dumping data for table `Rulesets` -- @@ -158,7 +202,7 @@ CREATE TABLE `Hand` ( `status` enum('start','init','check','poverty','play','gameover') default 'start', `position` tinyint(4) NOT NULL default '0', `party` enum('re','contra') default NULL, - `sickness` enum('wedding','nines','poverty','solo') default NULL, + `sickness` enum('wedding','nines','poverty','solo','lowtrump') default NULL, `solo` enum('trumpless','jack','queen','trump','club','spade','heart','silent') default NULL, `point_call` enum('120','90','60','30','0') default NULL, UNIQUE KEY `id` (`id`), @@ -200,6 +244,32 @@ LOCK TABLES `Hand_Card` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `Hand_Card` ENABLE KEYS */; +-- +-- Table structure for table `Card_Exchange` +-- + +DROP TABLE IF EXISTS `Card_Exchange`; +CREATE TABLE `Card_Exchange` ( + `id` int(11) NOT NULL auto_increment, + `orig_hand_id` int(11) NOT NULL default '0', + `new_hand_id` int(11) NOT NULL default '0', + `card_id` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`), + KEY `orig_hand_id` (`orig_hand_id`), + KEY `new_hand_id` (`new_hand_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `Hand_Card` +-- + + +/*!40000 ALTER TABLE `Hand_Card` DISABLE KEYS */; +LOCK TABLES `Card_Exchange` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `Hand_Card` ENABLE KEYS */; + + -- -- Table structure for table `Play` -- @@ -238,7 +308,7 @@ CREATE TABLE `Score` ( `party` enum('re','contra') default NULL , `winner_id` int(11) default NULL , `looser_id` int(11) default NULL , - `score` enum('120', 'call120','against120','90','call90','against90','made90' + `score` enum('120', 'call120','against120','90','call90','against90','made90', '60','call60','against60','made60','30','call30','against30','made30', '0','call0','against0','made0', 'fox','karlchen','dulle','doko','againstqueens') default NULL, @@ -290,7 +360,7 @@ CREATE TABLE `User` ( `id` int(11) NOT NULL auto_increment, `fullname` varchar(64) default NULL, `email` varchar(64) default NULL, - `password` varchar(32) default NULL, + `password` varchar(62) default NULL, `timezone` varchar(64) default 'Europe/London', `last_login` timestamp NOT NULL default '0000-00-00 00:00:00', `create_date` timestamp NOT NULL default '0000-00-00 00:00:00', @@ -408,3 +478,25 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +DROP TABLE IF EXISTS `user_openids`; +create table user_openids ( + openid_url varchar(255) not null, + primary key (openid_url), + + user_id int not null, + index (user_id) +); + +DROP TABLE IF EXISTS `digest_email`; +create table digest_email ( + `id` int(11) NOT NULL auto_increment, + `email` varchar(255) default null, + `create_date` timestamp NOT NULL default '0000-00-00 00:00:00', + `type` enum('misc','your_turn') NOT NULL default 'misc', + `game_id` int(11) default NULL, + `content` text, + UNIQUE KEY `id` (`id`), + index (email) +); + +