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' */;
16 -- Table structure for table `Card`
19 DROP TABLE IF EXISTS `Card`;
21 `id` int(11) NOT NULL auto_increment,
22 `suite` enum('diamonds','hearts','spades','clubs') NOT NULL default 'diamonds',
23 `strength` enum('nine','ten','jack','queen','king','ace') NOT NULL default 'nine',
24 `points` tinyint(4) NOT NULL default '0',
25 UNIQUE KEY `id` (`id`)
26 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
29 -- Dumping data for table `Card`
33 /*!40000 ALTER TABLE `Card` DISABLE KEYS */;
34 LOCK TABLES `Card` WRITE;
35 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);
37 /*!40000 ALTER TABLE `Card` ENABLE KEYS */;
40 -- Table structure for table `Comment`
43 DROP TABLE IF EXISTS `Comment`;
44 CREATE TABLE `Comment` (
45 `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
46 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
47 `id` int(11) NOT NULL auto_increment,
48 `user_id` int(11) default NULL,
49 `play_id` int(11) default NULL,
51 UNIQUE KEY `id` (`id`),
52 KEY `play_id` (`play_id`)
53 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
56 -- Dumping data for table `Comment`
60 /*!40000 ALTER TABLE `Comment` DISABLE KEYS */;
61 LOCK TABLES `Comment` WRITE;
63 /*!40000 ALTER TABLE `Comment` ENABLE KEYS */;
66 -- Table structure for table `Notes`
69 DROP TABLE IF EXISTS `Notes`;
70 CREATE TABLE `Notes` (
71 `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
72 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
73 `id` int(11) NOT NULL auto_increment,
74 `user_id` int(11) default NULL,
75 `game_id` int(11) default NULL,
77 UNIQUE KEY `id` (`id`)
78 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
81 -- Dumping data for table `Notes`
84 /*!40000 ALTER TABLE `Notes` DISABLE KEYS */;
85 LOCK TABLES `Notes` WRITE;
87 /*!40000 ALTER TABLE `Notes` ENABLE KEYS */;
90 -- Table structure for table `Game`
93 DROP TABLE IF EXISTS `Game`;
95 `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
96 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
97 `randomnumbers` varchar(136) default NULL,
98 `type` enum('normal','solo','wedding','poverty','dpoverty') default NULL,
99 `solo` enum('trumpless','jack','queen','trump','club','spade','heart','silent') default NULL,
100 `sickness` int(11) default NULL,
101 `startplayer` tinyint(4) default '1',
102 `player` int(11) default NULL,
103 `status` enum('pre','play','gameover') default NULL,
104 `ruleset` int(11) default NULL,
105 `session` int(11) default NULL,
106 `id` int(11) NOT NULL auto_increment,
107 UNIQUE KEY `id` (`id`),
108 KEY `session` (`session`)
109 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
112 -- Dumping data for table `Game`
116 /*!40000 ALTER TABLE `Game` DISABLE KEYS */;
117 LOCK TABLES `Game` WRITE;
119 /*!40000 ALTER TABLE `Game` ENABLE KEYS */;
123 -- Table structure for table `Ruleset`
126 DROP TABLE IF EXISTS `Rulesets`;
127 CREATE TABLE `Rulesets` (
128 `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
129 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
130 `dullen` enum('none','firstwins','secondwins') default 'secondwins',
131 `schweinchen` enum ('none','both','second','secondaftercall') default 'second',
132 `call` enum ('1st-own-card','5th-card','9-cards') default '1st-own-card',
133 `id` int(11) NOT NULL auto_increment,
134 UNIQUE KEY `id` (`id`)
135 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
138 -- Dumping data for table `Rulesets`
142 /*!40000 ALTER TABLE `Rulesets` DISABLE KEYS */;
143 LOCK TABLES `Rulesets` WRITE;
145 /*!40000 ALTER TABLE `Rulesets` ENABLE KEYS */;
150 -- Table structure for table `Hand`
153 DROP TABLE IF EXISTS `Hand`;
154 CREATE TABLE `Hand` (
155 `id` int(11) NOT NULL auto_increment,
156 `game_id` int(11) NOT NULL default '0',
157 `user_id` int(11) NOT NULL default '0',
158 `hash` varchar(33) default NULL,
159 `status` enum('start','init','check','poverty','play','gameover') default 'start',
160 `position` tinyint(4) NOT NULL default '0',
161 `party` enum('re','contra') default NULL,
162 `sickness` enum('wedding','nines','poverty','solo') default NULL,
163 `solo` enum('trumpless','jack','queen','trump','club','spade','heart','silent') default NULL,
164 `point_call` enum('120','90','60','30','0') default NULL,
165 UNIQUE KEY `id` (`id`),
166 KEY `game_id` (`game_id`),
167 KEY `user_id` (`user_id`)
168 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
171 -- Dumping data for table `Hand`
175 /*!40000 ALTER TABLE `Hand` DISABLE KEYS */;
176 LOCK TABLES `Hand` WRITE;
178 /*!40000 ALTER TABLE `Hand` ENABLE KEYS */;
181 -- Table structure for table `Hand_Card`
184 DROP TABLE IF EXISTS `Hand_Card`;
185 CREATE TABLE `Hand_Card` (
186 `id` int(11) NOT NULL auto_increment,
187 `hand_id` int(11) NOT NULL default '0',
188 `card_id` int(11) NOT NULL default '0',
189 `played` enum('true','false') default 'false',
190 UNIQUE KEY `id` (`id`),
191 KEY `hand_id` (`hand_id`)
192 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
195 -- Dumping data for table `Hand_Card`
199 /*!40000 ALTER TABLE `Hand_Card` DISABLE KEYS */;
200 LOCK TABLES `Hand_Card` WRITE;
202 /*!40000 ALTER TABLE `Hand_Card` ENABLE KEYS */;
205 -- Table structure for table `Card_Exchange`
208 DROP TABLE IF EXISTS `Card_Exchange`;
209 CREATE TABLE `Card_Exchange` (
210 `id` int(11) NOT NULL auto_increment,
211 `orig_hand_id` int(11) NOT NULL default '0',
212 `new_hand_id` int(11) NOT NULL default '0',
213 `card_id` int(11) NOT NULL default '0',
214 UNIQUE KEY `id` (`id`),
215 KEY `orig_hand_id` (`orig_hand_id`),
216 KEY `new_hand_id` (`new_hand_id`)
217 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
220 -- Dumping data for table `Hand_Card`
224 /*!40000 ALTER TABLE `Hand_Card` DISABLE KEYS */;
225 LOCK TABLES `Hand_Card` WRITE;
227 /*!40000 ALTER TABLE `Hand_Card` ENABLE KEYS */;
231 -- Table structure for table `Play`
234 DROP TABLE IF EXISTS `Play`;
235 CREATE TABLE `Play` (
236 `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
237 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
238 `id` int(11) NOT NULL auto_increment,
239 `trick_id` int(11) NOT NULL default '0',
240 `hand_card_id` int(11) NOT NULL default '0',
241 `sequence` tinyint(4) NOT NULL default '0',
242 UNIQUE KEY `id` (`id`),
243 KEY `trick_id` (`trick_id`)
244 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
247 -- Dumping data for table `Play`
251 /*!40000 ALTER TABLE `Play` DISABLE KEYS */;
252 LOCK TABLES `Play` WRITE;
254 /*!40000 ALTER TABLE `Play` ENABLE KEYS */;
257 -- Table structure for table `Score`
260 DROP TABLE IF EXISTS `Score`;
261 CREATE TABLE `Score` (
262 `id` int(11) NOT NULL auto_increment,
263 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
264 `game_id` int(11) NOT NULL default '0',
265 `party` enum('re','contra') default NULL ,
266 `winner_id` int(11) default NULL ,
267 `looser_id` int(11) default NULL ,
268 `score` enum('120', 'call120','against120','90','call90','against90','made90',
269 '60','call60','against60','made60','30','call30','against30','made30',
270 '0','call0','against0','made0',
271 'fox','karlchen','dulle','doko','againstqueens') default NULL,
272 UNIQUE KEY `id` (`id`),
273 KEY `game_id` (`game_id`)
274 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
277 -- Dumping data for table `Score`
281 /*!40000 ALTER TABLE `Score` DISABLE KEYS */;
282 LOCK TABLES `Score` WRITE;
284 /*!40000 ALTER TABLE `Score` ENABLE KEYS */;
287 -- Table structure for table `Trick`
290 DROP TABLE IF EXISTS `Trick`;
291 CREATE TABLE `Trick` (
292 `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
293 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
294 `id` int(11) NOT NULL auto_increment,
295 `game_id` int(11) NOT NULL default '0',
296 `winner` tinyint(4) default NULL,
297 UNIQUE KEY `id` (`id`),
298 KEY `game_id` (`game_id`)
299 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
302 -- Dumping data for table `Trick`
306 /*!40000 ALTER TABLE `Trick` DISABLE KEYS */;
307 LOCK TABLES `Trick` WRITE;
309 /*!40000 ALTER TABLE `Trick` ENABLE KEYS */;
312 -- Table structure for table `User`
315 DROP TABLE IF EXISTS `User`;
316 CREATE TABLE `User` (
317 `id` int(11) NOT NULL auto_increment,
318 `fullname` varchar(64) default NULL,
319 `email` varchar(64) default NULL,
320 `password` varchar(32) default NULL,
321 `timezone` varchar(64) default 'Europe/London',
322 `last_login` timestamp NOT NULL default '0000-00-00 00:00:00',
323 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
324 UNIQUE KEY `id` (`id`)
325 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
328 -- Dumping data for table `User`
332 /*!40000 ALTER TABLE `User` DISABLE KEYS */;
333 LOCK TABLES `User` WRITE;
335 /*!40000 ALTER TABLE `User` ENABLE KEYS */;
338 -- Table structure for table `User_Game_Prefs`
341 DROP TABLE IF EXISTS `User_Game_Prefs`;
342 CREATE TABLE `User_Game_Prefs` (
343 `id` int(11) NOT NULL auto_increment,
344 `user_id` int(11) NOT NULL default '0',
345 `game_id` int(11) NOT NULL default '0',
346 `pref_key` varchar(64) default NULL,
347 `value` varchar(64) default NULL,
348 UNIQUE KEY `id` (`id`),
349 KEY `user_id` (`user_id`)
350 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
353 -- Dumping data for table `User_Game_Prefs`
357 /*!40000 ALTER TABLE `User_Game_Prefs` DISABLE KEYS */;
358 LOCK TABLES `User_Game_Prefs` WRITE;
360 /*!40000 ALTER TABLE `User_Game_Prefs` ENABLE KEYS */;
363 -- Table structure for table `User_Prefs`
366 DROP TABLE IF EXISTS `User_Prefs`;
367 CREATE TABLE `User_Prefs` (
368 `id` int(11) NOT NULL auto_increment,
369 `user_id` int(11) NOT NULL default '0',
370 `pref_key` varchar(64) default NULL,
371 `value` varchar(64) default NULL,
372 UNIQUE KEY `id` (`id`),
373 KEY `user_id` (`user_id`)
374 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
377 -- Dumping data for table `User_Prefs`
383 /*!40000 ALTER TABLE `Recovery` DISABLE KEYS */;
384 LOCK TABLES `Recovery` WRITE;
386 /*!40000 ALTER TABLE `Recovery` ENABLE KEYS */;
389 DROP TABLE IF EXISTS `Recovery`;
390 CREATE TABLE `Recovery` (
391 `id` int(11) NOT NULL auto_increment,
392 `user_id` int(11) NOT NULL default '0',
393 `password` varchar(32) default NULL,
394 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
395 UNIQUE KEY `id` (`id`)
396 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
399 -- Dumping data for table `Recovery`
402 /*!40000 ALTER TABLE `Recovery` DISABLE KEYS */;
403 LOCK TABLES `Recovery` WRITE;
405 /*!40000 ALTER TABLE `Recovery` ENABLE KEYS */;
407 /*!40000 ALTER TABLE `Reminder` DISABLE KEYS */;
408 LOCK TABLES `Reminder` WRITE;
410 /*!40000 ALTER TABLE `Reminder` ENABLE KEYS */;
412 DROP TABLE IF EXISTS `Reminder`;
413 CREATE TABLE `Reminder` (
414 `id` int(11) NOT NULL auto_increment,
415 `user_id` int(11) NOT NULL default '0',
416 `game_id` int(11) NOT NULL default '0',
417 `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
418 UNIQUE KEY `id` (`id`)
419 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
422 -- Dumping data for table `Reminder`
425 /*!40000 ALTER TABLE `Reminder` DISABLE KEYS */;
426 LOCK TABLES `Reminder` WRITE;
428 /*!40000 ALTER TABLE `Reminder` ENABLE KEYS */;
431 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
432 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
433 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
434 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
435 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
436 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;