3 -- Host: localhost Database: doko
4 -- ------------------------------------------------------
5 -- Server version 4.1.10
7 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10 /*!40101 SET NAMES utf8 */;
11 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
12 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
13 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
17 -- Table structure for table `Version`
20 DROP TABLE IF EXISTS `Version`;
21 CREATE TABLE `Version` (
22 `version` int NOT NULL default '0'
23 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
26 -- Dumping data for table `Card`
30 /*!40000 ALTER TABLE `Card` DISABLE KEYS */;
31 LOCK TABLES `Version` WRITE;
32 INSERT INTO `Version` VALUES (1);
34 /*!40000 ALTER TABLE `Version` ENABLE KEYS */;
38 -- Table structure for table `Card`
41 DROP TABLE IF EXISTS `Card`;
43 `id` int(11) NOT NULL auto_increment,
44 `suite` enum('diamonds','hearts','spades','clubs') NOT NULL default 'diamonds',
45 `strength` enum('nine','ten','jack','queen','king','ace') NOT NULL default 'nine',
46 `points` tinyint(4) NOT NULL default '0',
47 UNIQUE KEY `id` (`id`)
48 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
51 -- Dumping data for table `Card`
55 /*!40000 ALTER TABLE `Card` DISABLE KEYS */;
56 LOCK TABLES `Card` WRITE;
57 INSERT INTO `Card` VALUES (1,'hearts','ten',10),(2,'hearts','ten',10),(3,'clubs','queen',3),(4,'clubs','queen',3),(5,'spades','queen',3),(6,'spades','queen',3),(7,'hearts','queen',3),(8,'hearts','queen',3),(9,'diamonds','queen',3),(10,'diamonds','queen',3),(11,'clubs','jack',2),(12,'clubs','jack',2),(13,'spades','jack',2),(14,'spades','jack',2),(15,'hearts','jack',2),(16,'hearts','jack',2),(17,'diamonds','jack',2),(18,'diamonds','jack',2),(19,'diamonds','ace',11),(20,'diamonds','ace',11),(21,'diamonds','ten',10),(22,'diamonds','ten',10),(23,'diamonds','king',4),(24,'diamonds','king',4),(25,'diamonds','nine',0),(26,'diamonds','nine',0),(27,'clubs','ace',11),(28,'clubs','ace',11),(29,'clubs','ten',10),(30,'clubs','ten',10),(31,'clubs','king',4),(32,'clubs','king',4),(33,'clubs','nine',0),(34,'clubs','nine',0),(35,'spades','ace',11),(36,'spades','ace',11),(37,'spades','ten',10),(38,'spades','ten',10),(39,'spades','king',4),(40,'spades','king',4),(41,'spades','nine',0),(42,'spades','nine',0),(43,'hearts','ace',11),(44,'hearts','ace',11),(45,'hearts','king',4),(46,'hearts','king',4),(47,'hearts','nine',0),(48,'hearts','nine',0);
59 /*!40000 ALTER TABLE `Card` ENABLE KEYS */;
62 -- Table structure for table `Comment`
65 DROP TABLE IF EXISTS `Comment`;
66 CREATE TABLE `Comment` (
67 `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
68 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
69 `id` int(11) NOT NULL auto_increment,
70 `user_id` int(11) default NULL,
71 `play_id` int(11) default NULL,
73 UNIQUE KEY `id` (`id`),
74 KEY `play_id` (`play_id`)
75 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
78 -- Dumping data for table `Comment`
82 /*!40000 ALTER TABLE `Comment` DISABLE KEYS */;
83 LOCK TABLES `Comment` WRITE;
85 /*!40000 ALTER TABLE `Comment` ENABLE KEYS */;
88 -- Table structure for table `Notes`
91 DROP TABLE IF EXISTS `Notes`;
92 CREATE TABLE `Notes` (
93 `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
94 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
95 `id` int(11) NOT NULL auto_increment,
96 `user_id` int(11) default NULL,
97 `game_id` int(11) default NULL,
99 UNIQUE KEY `id` (`id`)
100 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
103 -- Dumping data for table `Notes`
106 /*!40000 ALTER TABLE `Notes` DISABLE KEYS */;
107 LOCK TABLES `Notes` WRITE;
109 /*!40000 ALTER TABLE `Notes` ENABLE KEYS */;
112 -- Table structure for table `Game`
115 DROP TABLE IF EXISTS `Game`;
116 CREATE TABLE `Game` (
117 `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
118 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
119 `randomnumbers` varchar(136) default NULL,
120 `type` enum('normal','solo','wedding','poverty','dpoverty') default NULL,
121 `solo` enum('trumpless','jack','queen','trump','club','spade','heart','silent') default NULL,
122 `sickness` int(11) default NULL,
123 `startplayer` tinyint(4) default '1',
124 `player` int(11) default NULL,
125 `status` enum('pre','play','gameover','cancel-timedout','cancel-nines','cancel-trump','cancel-noplay') default NULL,
126 `ruleset` int(11) default NULL,
127 `session` int(11) default NULL,
128 `id` int(11) NOT NULL auto_increment,
129 UNIQUE KEY `id` (`id`),
130 KEY `session` (`session`)
131 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
134 -- Dumping data for table `Game`
138 /*!40000 ALTER TABLE `Game` DISABLE KEYS */;
139 LOCK TABLES `Game` WRITE;
141 /*!40000 ALTER TABLE `Game` ENABLE KEYS */;
145 -- Table structure for table `Ruleset`
148 DROP TABLE IF EXISTS `Rulesets`;
149 CREATE TABLE `Rulesets` (
150 `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
151 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
152 `dullen` enum('none','firstwins','secondwins') default 'secondwins',
153 `schweinchen` enum ('none','both','second','secondaftercall') default 'second',
154 `call` enum ('1st-own-card','5th-card','9-cards') default '1st-own-card',
155 `id` int(11) NOT NULL auto_increment,
156 UNIQUE KEY `id` (`id`)
157 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
160 -- Dumping data for table `Rulesets`
164 /*!40000 ALTER TABLE `Rulesets` DISABLE KEYS */;
165 LOCK TABLES `Rulesets` WRITE;
167 /*!40000 ALTER TABLE `Rulesets` ENABLE KEYS */;
172 -- Table structure for table `Hand`
175 DROP TABLE IF EXISTS `Hand`;
176 CREATE TABLE `Hand` (
177 `id` int(11) NOT NULL auto_increment,
178 `game_id` int(11) NOT NULL default '0',
179 `user_id` int(11) NOT NULL default '0',
180 `hash` varchar(33) default NULL,
181 `status` enum('start','init','check','poverty','play','gameover') default 'start',
182 `position` tinyint(4) NOT NULL default '0',
183 `party` enum('re','contra') default NULL,
184 `sickness` enum('wedding','nines','poverty','solo') default NULL,
185 `solo` enum('trumpless','jack','queen','trump','club','spade','heart','silent') default NULL,
186 `point_call` enum('120','90','60','30','0') default NULL,
187 UNIQUE KEY `id` (`id`),
188 KEY `game_id` (`game_id`),
189 KEY `user_id` (`user_id`)
190 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
193 -- Dumping data for table `Hand`
197 /*!40000 ALTER TABLE `Hand` DISABLE KEYS */;
198 LOCK TABLES `Hand` WRITE;
200 /*!40000 ALTER TABLE `Hand` ENABLE KEYS */;
203 -- Table structure for table `Hand_Card`
206 DROP TABLE IF EXISTS `Hand_Card`;
207 CREATE TABLE `Hand_Card` (
208 `id` int(11) NOT NULL auto_increment,
209 `hand_id` int(11) NOT NULL default '0',
210 `card_id` int(11) NOT NULL default '0',
211 `played` enum('true','false') default 'false',
212 UNIQUE KEY `id` (`id`),
213 KEY `hand_id` (`hand_id`)
214 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
217 -- Dumping data for table `Hand_Card`
221 /*!40000 ALTER TABLE `Hand_Card` DISABLE KEYS */;
222 LOCK TABLES `Hand_Card` WRITE;
224 /*!40000 ALTER TABLE `Hand_Card` ENABLE KEYS */;
227 -- Table structure for table `Card_Exchange`
230 DROP TABLE IF EXISTS `Card_Exchange`;
231 CREATE TABLE `Card_Exchange` (
232 `id` int(11) NOT NULL auto_increment,
233 `orig_hand_id` int(11) NOT NULL default '0',
234 `new_hand_id` int(11) NOT NULL default '0',
235 `card_id` int(11) NOT NULL default '0',
236 UNIQUE KEY `id` (`id`),
237 KEY `orig_hand_id` (`orig_hand_id`),
238 KEY `new_hand_id` (`new_hand_id`)
239 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
242 -- Dumping data for table `Hand_Card`
246 /*!40000 ALTER TABLE `Hand_Card` DISABLE KEYS */;
247 LOCK TABLES `Hand_Card` WRITE;
249 /*!40000 ALTER TABLE `Hand_Card` ENABLE KEYS */;
253 -- Table structure for table `Play`
256 DROP TABLE IF EXISTS `Play`;
257 CREATE TABLE `Play` (
258 `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
259 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
260 `id` int(11) NOT NULL auto_increment,
261 `trick_id` int(11) NOT NULL default '0',
262 `hand_card_id` int(11) NOT NULL default '0',
263 `sequence` tinyint(4) NOT NULL default '0',
264 UNIQUE KEY `id` (`id`),
265 KEY `trick_id` (`trick_id`)
266 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
269 -- Dumping data for table `Play`
273 /*!40000 ALTER TABLE `Play` DISABLE KEYS */;
274 LOCK TABLES `Play` WRITE;
276 /*!40000 ALTER TABLE `Play` ENABLE KEYS */;
279 -- Table structure for table `Score`
282 DROP TABLE IF EXISTS `Score`;
283 CREATE TABLE `Score` (
284 `id` int(11) NOT NULL auto_increment,
285 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
286 `game_id` int(11) NOT NULL default '0',
287 `party` enum('re','contra') default NULL ,
288 `winner_id` int(11) default NULL ,
289 `looser_id` int(11) default NULL ,
290 `score` enum('120', 'call120','against120','90','call90','against90','made90',
291 '60','call60','against60','made60','30','call30','against30','made30',
292 '0','call0','against0','made0',
293 'fox','karlchen','dulle','doko','againstqueens') default NULL,
294 UNIQUE KEY `id` (`id`),
295 KEY `game_id` (`game_id`)
296 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
299 -- Dumping data for table `Score`
303 /*!40000 ALTER TABLE `Score` DISABLE KEYS */;
304 LOCK TABLES `Score` WRITE;
306 /*!40000 ALTER TABLE `Score` ENABLE KEYS */;
309 -- Table structure for table `Trick`
312 DROP TABLE IF EXISTS `Trick`;
313 CREATE TABLE `Trick` (
314 `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
315 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
316 `id` int(11) NOT NULL auto_increment,
317 `game_id` int(11) NOT NULL default '0',
318 `winner` tinyint(4) default NULL,
319 UNIQUE KEY `id` (`id`),
320 KEY `game_id` (`game_id`)
321 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
324 -- Dumping data for table `Trick`
328 /*!40000 ALTER TABLE `Trick` DISABLE KEYS */;
329 LOCK TABLES `Trick` WRITE;
331 /*!40000 ALTER TABLE `Trick` ENABLE KEYS */;
334 -- Table structure for table `User`
337 DROP TABLE IF EXISTS `User`;
338 CREATE TABLE `User` (
339 `id` int(11) NOT NULL auto_increment,
340 `fullname` varchar(64) default NULL,
341 `email` varchar(64) default NULL,
342 `password` varchar(32) default NULL,
343 `timezone` varchar(64) default 'Europe/London',
344 `last_login` timestamp NOT NULL default '0000-00-00 00:00:00',
345 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
346 UNIQUE KEY `id` (`id`)
347 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
350 -- Dumping data for table `User`
354 /*!40000 ALTER TABLE `User` DISABLE KEYS */;
355 LOCK TABLES `User` WRITE;
357 /*!40000 ALTER TABLE `User` ENABLE KEYS */;
360 -- Table structure for table `User_Game_Prefs`
363 DROP TABLE IF EXISTS `User_Game_Prefs`;
364 CREATE TABLE `User_Game_Prefs` (
365 `id` int(11) NOT NULL auto_increment,
366 `user_id` int(11) NOT NULL default '0',
367 `game_id` int(11) NOT NULL default '0',
368 `pref_key` varchar(64) default NULL,
369 `value` varchar(64) default NULL,
370 UNIQUE KEY `id` (`id`),
371 KEY `user_id` (`user_id`)
372 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
375 -- Dumping data for table `User_Game_Prefs`
379 /*!40000 ALTER TABLE `User_Game_Prefs` DISABLE KEYS */;
380 LOCK TABLES `User_Game_Prefs` WRITE;
382 /*!40000 ALTER TABLE `User_Game_Prefs` ENABLE KEYS */;
385 -- Table structure for table `User_Prefs`
388 DROP TABLE IF EXISTS `User_Prefs`;
389 CREATE TABLE `User_Prefs` (
390 `id` int(11) NOT NULL auto_increment,
391 `user_id` int(11) NOT NULL default '0',
392 `pref_key` varchar(64) default NULL,
393 `value` varchar(64) default NULL,
394 UNIQUE KEY `id` (`id`),
395 KEY `user_id` (`user_id`)
396 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
399 -- Dumping data for table `User_Prefs`
405 /*!40000 ALTER TABLE `Recovery` DISABLE KEYS */;
406 LOCK TABLES `Recovery` WRITE;
408 /*!40000 ALTER TABLE `Recovery` ENABLE KEYS */;
411 DROP TABLE IF EXISTS `Recovery`;
412 CREATE TABLE `Recovery` (
413 `id` int(11) NOT NULL auto_increment,
414 `user_id` int(11) NOT NULL default '0',
415 `password` varchar(32) default NULL,
416 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
417 UNIQUE KEY `id` (`id`)
418 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
421 -- Dumping data for table `Recovery`
424 /*!40000 ALTER TABLE `Recovery` DISABLE KEYS */;
425 LOCK TABLES `Recovery` WRITE;
427 /*!40000 ALTER TABLE `Recovery` ENABLE KEYS */;
429 /*!40000 ALTER TABLE `Reminder` DISABLE KEYS */;
430 LOCK TABLES `Reminder` WRITE;
432 /*!40000 ALTER TABLE `Reminder` ENABLE KEYS */;
434 DROP TABLE IF EXISTS `Reminder`;
435 CREATE TABLE `Reminder` (
436 `id` int(11) NOT NULL auto_increment,
437 `user_id` int(11) NOT NULL default '0',
438 `game_id` int(11) NOT NULL default '0',
439 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
440 UNIQUE KEY `id` (`id`)
441 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
444 -- Dumping data for table `Reminder`
447 /*!40000 ALTER TABLE `Reminder` DISABLE KEYS */;
448 LOCK TABLES `Reminder` WRITE;
450 /*!40000 ALTER TABLE `Reminder` ENABLE KEYS */;
453 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
454 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
455 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
456 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
457 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
458 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
460 DROP TABLE IF EXISTS `user_openids`;
461 create table user_openids (
462 openid_url varchar(255) not null,
463 primary key (openid_url),
465 user_id int not null,
469 DROP TABLE IF EXISTS `digest_email`;
470 create table digest_email (
471 `id` int(11) NOT NULL auto_increment,
472 `email` varchar(255) default null,
473 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
475 UNIQUE KEY `id` (`id`),