updated translation
[e-DoKo.git] / create_database.sql
1 /* Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 Arun Persaud <arun@nubati.net>
2  *
3  *   This file is part of e-DoKo.
4  *
5  *   e-DoKo is free software: you can redistribute it and/or modify
6  *   it under the terms of the GNU General Public License as published by
7  *   the Free Software Foundation, either version 3 of the License, or
8  *   (at your option) any later version.
9  *
10  *   e-DoKo is distributed in the hope that it will be useful,
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *   GNU General Public License for more details.
14  *
15  *   You should have received a copy of the GNU General Public License
16  *   along with e-DoKo.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  */
19
20 -- MySQL dump 10.9
21 --
22 -- Host: localhost    Database: doko
23 -- ------------------------------------------------------
24 -- Server version       4.1.10
25
26 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
27 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
28 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
29 /*!40101 SET NAMES utf8 */;
30 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
31 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
32 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
33
34
35 --
36 -- Table structure for table `Version`
37 --
38
39 DROP TABLE IF EXISTS `Version`;
40 CREATE TABLE `Version` (
41   `version` int NOT NULL default '0'
42 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
43
44 --
45 -- Dumping data for table `Card`
46 --
47
48
49 /*!40000 ALTER TABLE `Card` DISABLE KEYS */;
50 LOCK TABLES `Version` WRITE;
51 INSERT INTO `Version` VALUES (2);
52 UNLOCK TABLES;
53 /*!40000 ALTER TABLE `Version` ENABLE KEYS */;
54
55
56 --
57 -- Table structure for table `Card`
58 --
59
60 DROP TABLE IF EXISTS `Card`;
61 CREATE TABLE `Card` (
62   `id` int(11) NOT NULL auto_increment,
63   `suite` enum('diamonds','hearts','spades','clubs') NOT NULL default 'diamonds',
64   `strength` enum('nine','ten','jack','queen','king','ace') NOT NULL default 'nine',
65   `points` tinyint(4) NOT NULL default '0',
66   UNIQUE KEY `id` (`id`)
67 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
68
69 --
70 -- Dumping data for table `Card`
71 --
72
73
74 /*!40000 ALTER TABLE `Card` DISABLE KEYS */;
75 LOCK TABLES `Card` WRITE;
76 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);
77 UNLOCK TABLES;
78 /*!40000 ALTER TABLE `Card` ENABLE KEYS */;
79
80 --
81 -- Table structure for table `Comment`
82 --
83
84 DROP TABLE IF EXISTS `Comment`;
85 CREATE TABLE `Comment` (
86   `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
87   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
88   `id` int(11) NOT NULL auto_increment,
89   `user_id` int(11) default NULL,
90   `play_id` int(11) default NULL,
91   `game_id` int(11) default NULL,
92   `comment` text,
93   UNIQUE KEY `id` (`id`),
94   KEY `play_id` (`play_id`)
95 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
96
97 --
98 -- Dumping data for table `Comment`
99 --
100
101
102 /*!40000 ALTER TABLE `Comment` DISABLE KEYS */;
103 LOCK TABLES `Comment` WRITE;
104 UNLOCK TABLES;
105 /*!40000 ALTER TABLE `Comment` ENABLE KEYS */;
106
107 --
108 -- Table structure for table `Notes`
109 --
110
111 DROP TABLE IF EXISTS `Notes`;
112 CREATE TABLE `Notes` (
113   `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
114   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
115   `id` int(11) NOT NULL auto_increment,
116   `user_id` int(11) default NULL,
117   `game_id` int(11) default NULL,
118   `comment` text,
119   UNIQUE KEY `id` (`id`)
120 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
121
122 --
123 -- Dumping data for table `Notes`
124 --
125
126 /*!40000 ALTER TABLE `Notes` DISABLE KEYS */;
127 LOCK TABLES `Notes` WRITE;
128 UNLOCK TABLES;
129 /*!40000 ALTER TABLE `Notes` ENABLE KEYS */;
130
131 --
132 -- Table structure for table `Game`
133 --
134
135 DROP TABLE IF EXISTS `Game`;
136 CREATE TABLE `Game` (
137   `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
138   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
139   `randomnumbers` varchar(136) default NULL,
140   `type` enum('normal','solo','wedding','poverty','dpoverty') default NULL,
141   `solo` enum('trumpless','jack','queen','trump','club','spade','heart','silent') default NULL,
142   `sickness` int(11) default NULL,
143   `startplayer` tinyint(4) default '1',
144   `player` int(11) default NULL,
145   `status` enum('pre','play','gameover','cancel-timedout','cancel-nines','cancel-trump','cancel-noplay','cancel-lowtrump') default NULL,
146   `ruleset` int(11) default NULL,
147   `session` int(11) default NULL,
148   `id` int(11) NOT NULL auto_increment,
149   UNIQUE KEY `id` (`id`),
150   KEY `session` (`session`)
151 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
152
153 --
154 -- Dumping data for table `Game`
155 --
156
157
158 /*!40000 ALTER TABLE `Game` DISABLE KEYS */;
159 LOCK TABLES `Game` WRITE;
160 UNLOCK TABLES;
161 /*!40000 ALTER TABLE `Game` ENABLE KEYS */;
162
163
164 --
165 -- Table structure for table `Ruleset`
166 --
167
168 DROP TABLE IF EXISTS `Rulesets`;
169 CREATE TABLE `Rulesets` (
170   `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
171   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
172   `dullen` enum('none','firstwins','secondwins') default 'secondwins',
173   `schweinchen` enum ('none','both','second','secondaftercall') default 'second',
174   `call` enum ('1st-own-card','5th-card','9-cards') default '1st-own-card',
175   `lowtrump` enum('poverty','cancel','none') default 'poverty',
176   `id` int(11) NOT NULL auto_increment,
177   UNIQUE KEY `id` (`id`)
178 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
179
180 --
181 -- Dumping data for table `Rulesets`
182 --
183
184
185 /*!40000 ALTER TABLE `Rulesets` DISABLE KEYS */;
186 LOCK TABLES `Rulesets` WRITE;
187 UNLOCK TABLES;
188 /*!40000 ALTER TABLE `Rulesets` ENABLE KEYS */;
189
190
191
192 --
193 -- Table structure for table `Hand`
194 --
195
196 DROP TABLE IF EXISTS `Hand`;
197 CREATE TABLE `Hand` (
198   `id` int(11) NOT NULL auto_increment,
199   `game_id` int(11) NOT NULL default '0',
200   `user_id` int(11) NOT NULL default '0',
201   `hash` varchar(33) default NULL,
202   `status` enum('start','init','check','poverty','play','gameover') default 'start',
203   `position` tinyint(4) NOT NULL default '0',
204   `party` enum('re','contra') default NULL,
205   `sickness` enum('wedding','nines','poverty','solo','lowtrump') default NULL,
206   `solo` enum('trumpless','jack','queen','trump','club','spade','heart','silent') default NULL,
207   `point_call` enum('120','90','60','30','0') default NULL,
208   UNIQUE KEY `id` (`id`),
209   KEY `game_id` (`game_id`),
210   KEY `user_id` (`user_id`)
211 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
212
213 --
214 -- Dumping data for table `Hand`
215 --
216
217
218 /*!40000 ALTER TABLE `Hand` DISABLE KEYS */;
219 LOCK TABLES `Hand` WRITE;
220 UNLOCK TABLES;
221 /*!40000 ALTER TABLE `Hand` ENABLE KEYS */;
222
223 --
224 -- Table structure for table `Hand_Card`
225 --
226
227 DROP TABLE IF EXISTS `Hand_Card`;
228 CREATE TABLE `Hand_Card` (
229   `id` int(11) NOT NULL auto_increment,
230   `hand_id` int(11) NOT NULL default '0',
231   `card_id` int(11) NOT NULL default '0',
232   `played` enum('true','false') default 'false',
233   UNIQUE KEY `id` (`id`),
234   KEY `hand_id` (`hand_id`)
235 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
236
237 --
238 -- Dumping data for table `Hand_Card`
239 --
240
241
242 /*!40000 ALTER TABLE `Hand_Card` DISABLE KEYS */;
243 LOCK TABLES `Hand_Card` WRITE;
244 UNLOCK TABLES;
245 /*!40000 ALTER TABLE `Hand_Card` ENABLE KEYS */;
246
247 --
248 -- Table structure for table `Card_Exchange`
249 --
250
251 DROP TABLE IF EXISTS `Card_Exchange`;
252 CREATE TABLE `Card_Exchange` (
253   `id` int(11) NOT NULL auto_increment,
254   `orig_hand_id` int(11) NOT NULL default '0',
255   `new_hand_id` int(11) NOT NULL default '0',
256   `card_id` int(11) NOT NULL default '0',
257   UNIQUE KEY `id` (`id`),
258   KEY `orig_hand_id` (`orig_hand_id`),
259   KEY `new_hand_id` (`new_hand_id`)
260 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
261
262 --
263 -- Dumping data for table `Hand_Card`
264 --
265
266
267 /*!40000 ALTER TABLE `Hand_Card` DISABLE KEYS */;
268 LOCK TABLES `Card_Exchange` WRITE;
269 UNLOCK TABLES;
270 /*!40000 ALTER TABLE `Hand_Card` ENABLE KEYS */;
271
272
273 --
274 -- Table structure for table `Play`
275 --
276
277 DROP TABLE IF EXISTS `Play`;
278 CREATE TABLE `Play` (
279   `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
280   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
281   `id` int(11) NOT NULL auto_increment,
282   `trick_id` int(11) NOT NULL default '0',
283   `hand_card_id` int(11) NOT NULL default '0',
284   `sequence` tinyint(4) NOT NULL default '0',
285   UNIQUE KEY `id` (`id`),
286   KEY `trick_id` (`trick_id`)
287 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
288
289 --
290 -- Dumping data for table `Play`
291 --
292
293
294 /*!40000 ALTER TABLE `Play` DISABLE KEYS */;
295 LOCK TABLES `Play` WRITE;
296 UNLOCK TABLES;
297 /*!40000 ALTER TABLE `Play` ENABLE KEYS */;
298
299 --
300 -- Table structure for table `Score`
301 --
302
303 DROP TABLE IF EXISTS `Score`;
304 CREATE TABLE `Score` (
305   `id` int(11) NOT NULL auto_increment,
306   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
307   `game_id` int(11) NOT NULL default '0',
308   `party` enum('re','contra') default NULL ,
309   `winner_id` int(11) default NULL ,
310   `looser_id` int(11) default NULL ,
311   `score` enum('120', 'call120','against120','90','call90','against90','made90',
312           '60','call60','against60','made60','30','call30','against30','made30',
313           '0','call0','against0','made0',
314           'fox','karlchen','dulle','doko','againstqueens') default NULL,
315   UNIQUE KEY `id` (`id`),
316   KEY `game_id` (`game_id`)
317 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
318
319 --
320 -- Dumping data for table `Score`
321 --
322
323
324 /*!40000 ALTER TABLE `Score` DISABLE KEYS */;
325 LOCK TABLES `Score` WRITE;
326 UNLOCK TABLES;
327 /*!40000 ALTER TABLE `Score` ENABLE KEYS */;
328
329 --
330 -- Table structure for table `Trick`
331 --
332
333 DROP TABLE IF EXISTS `Trick`;
334 CREATE TABLE `Trick` (
335   `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
336   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
337   `id` int(11) NOT NULL auto_increment,
338   `game_id` int(11) NOT NULL default '0',
339   `winner`  tinyint(4) default NULL,
340   UNIQUE KEY `id` (`id`),
341   KEY `game_id` (`game_id`)
342 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
343
344 --
345 -- Dumping data for table `Trick`
346 --
347
348
349 /*!40000 ALTER TABLE `Trick` DISABLE KEYS */;
350 LOCK TABLES `Trick` WRITE;
351 UNLOCK TABLES;
352 /*!40000 ALTER TABLE `Trick` ENABLE KEYS */;
353
354 --
355 -- Table structure for table `User`
356 --
357
358 DROP TABLE IF EXISTS `User`;
359 CREATE TABLE `User` (
360   `id` int(11) NOT NULL auto_increment,
361   `fullname` varchar(64) default NULL,
362   `email` varchar(64) default NULL,
363   `password` varchar(32) default NULL,
364   `timezone` varchar(64) default 'Europe/London',
365   `last_login` timestamp NOT NULL default '0000-00-00 00:00:00',
366   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
367   UNIQUE KEY `id` (`id`)
368 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
369
370 --
371 -- Dumping data for table `User`
372 --
373
374
375 /*!40000 ALTER TABLE `User` DISABLE KEYS */;
376 LOCK TABLES `User` WRITE;
377 UNLOCK TABLES;
378 /*!40000 ALTER TABLE `User` ENABLE KEYS */;
379
380 --
381 -- Table structure for table `User_Game_Prefs`
382 --
383
384 DROP TABLE IF EXISTS `User_Game_Prefs`;
385 CREATE TABLE `User_Game_Prefs` (
386   `id` int(11) NOT NULL auto_increment,
387   `user_id` int(11) NOT NULL default '0',
388   `game_id` int(11) NOT NULL default '0',
389   `pref_key` varchar(64) default NULL,
390   `value` varchar(64) default NULL,
391   UNIQUE KEY `id` (`id`),
392   KEY `user_id` (`user_id`)
393 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
394
395 --
396 -- Dumping data for table `User_Game_Prefs`
397 --
398
399
400 /*!40000 ALTER TABLE `User_Game_Prefs` DISABLE KEYS */;
401 LOCK TABLES `User_Game_Prefs` WRITE;
402 UNLOCK TABLES;
403 /*!40000 ALTER TABLE `User_Game_Prefs` ENABLE KEYS */;
404
405 --
406 -- Table structure for table `User_Prefs`
407 --
408
409 DROP TABLE IF EXISTS `User_Prefs`;
410 CREATE TABLE `User_Prefs` (
411   `id` int(11) NOT NULL auto_increment,
412   `user_id` int(11) NOT NULL default '0',
413   `pref_key` varchar(64) default NULL,
414   `value` varchar(64) default NULL,
415   UNIQUE KEY `id` (`id`),
416   KEY `user_id` (`user_id`)
417 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
418
419 --
420 -- Dumping data for table `User_Prefs`
421 --
422
423
424
425
426 /*!40000 ALTER TABLE `Recovery` DISABLE KEYS */;
427 LOCK TABLES `Recovery` WRITE;
428 UNLOCK TABLES;
429 /*!40000 ALTER TABLE `Recovery` ENABLE KEYS */;
430
431
432 DROP TABLE IF EXISTS `Recovery`;
433 CREATE TABLE `Recovery` (
434   `id` int(11) NOT NULL auto_increment,
435   `user_id` int(11) NOT NULL default '0',
436   `password` varchar(32) default NULL,
437   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
438   UNIQUE KEY `id` (`id`)
439 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
440
441 --
442 -- Dumping data for table `Recovery`
443 --
444
445 /*!40000 ALTER TABLE `Recovery` DISABLE KEYS */;
446 LOCK TABLES `Recovery` WRITE;
447 UNLOCK TABLES;
448 /*!40000 ALTER TABLE `Recovery` ENABLE KEYS */;
449
450 /*!40000 ALTER TABLE `Reminder` DISABLE KEYS */;
451 LOCK TABLES `Reminder` WRITE;
452 UNLOCK TABLES;
453 /*!40000 ALTER TABLE `Reminder` ENABLE KEYS */;
454
455 DROP TABLE IF EXISTS `Reminder`;
456 CREATE TABLE `Reminder` (
457   `id` int(11) NOT NULL auto_increment,
458   `user_id` int(11) NOT NULL default '0',
459   `game_id` int(11) NOT NULL default '0',
460   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
461   UNIQUE KEY `id` (`id`)
462 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
463
464 --
465 -- Dumping data for table `Reminder`
466 --
467
468 /*!40000 ALTER TABLE `Reminder` DISABLE KEYS */;
469 LOCK TABLES `Reminder` WRITE;
470 UNLOCK TABLES;
471 /*!40000 ALTER TABLE `Reminder` ENABLE KEYS */;
472
473
474 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
475 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
476 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
477 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
478 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
479 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
480
481 DROP TABLE IF EXISTS `user_openids`;
482 create table user_openids (
483   openid_url varchar(255) not null,
484   primary key (openid_url),
485
486   user_id int not null,
487   index (user_id)
488 );
489
490 DROP TABLE IF EXISTS `digest_email`;
491 create table digest_email (
492   `id` int(11) NOT NULL auto_increment,
493   `email` varchar(255) default null,
494   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
495   `content` text,
496   UNIQUE KEY `id` (`id`),
497   index (email)
498 );
499
500