tables seems to be case sensitive on dreamhost...fixed it
[e-DoKo.git] / create_database.sql
1 -- MySQL dump 10.9
2 --
3 -- Host: localhost    Database: doko
4 -- ------------------------------------------------------
5 -- Server version       4.1.10
6
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' */;
14
15 --
16 -- Table structure for table `Card`
17 --
18
19 DROP TABLE IF EXISTS `Card`;
20 CREATE TABLE `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;
27
28 --
29 -- Dumping data for table `Card`
30 --
31
32
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);
36 UNLOCK TABLES;
37 /*!40000 ALTER TABLE `Card` ENABLE KEYS */;
38
39 --
40 -- Table structure for table `Comment`
41 --
42
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,
50   `comment` text,
51   UNIQUE KEY `id` (`id`)
52 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
53
54 --
55 -- Dumping data for table `Comment`
56 --
57
58
59 /*!40000 ALTER TABLE `Comment` DISABLE KEYS */;
60 LOCK TABLES `Comment` WRITE;
61 UNLOCK TABLES;
62 /*!40000 ALTER TABLE `Comment` ENABLE KEYS */;
63
64 --
65 -- Table structure for table `Game`
66 --
67
68 DROP TABLE IF EXISTS `Game`;
69 CREATE TABLE `Game` (
70   `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
71   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
72   `randomnumbers` varchar(136) default NULL,
73   `type` enum('solo','wedding','poverty','dpoverty') default NULL,
74   `solo` enum('trumpless','jack','queen','trump','club','spade','heart','silent') default NULL,
75   `status` enum('pre','play','gameover') default NULL,
76   `id` int(11) NOT NULL auto_increment,
77   UNIQUE KEY `id` (`id`)
78 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
79
80 --
81 -- Dumping data for table `Game`
82 --
83
84
85 /*!40000 ALTER TABLE `Game` DISABLE KEYS */;
86 LOCK TABLES `Game` WRITE;
87 UNLOCK TABLES;
88 /*!40000 ALTER TABLE `Game` ENABLE KEYS */;
89
90 --
91 -- Table structure for table `Hand`
92 --
93
94 DROP TABLE IF EXISTS `Hand`;
95 CREATE TABLE `Hand` (
96   `id` int(11) NOT NULL auto_increment,
97   `game_id` int(11) NOT NULL default '0',
98   `user_id` int(11) NOT NULL default '0',
99   `hash` varchar(33) default NULL,
100   `status` enum('start','init','check','poverty','play','gameover') default 'start',
101   `position` tinyint(4) NOT NULL default '0',
102   `party` enum('re','contra') default NULL,
103   `sickness` enum('wedding','nines','poverty','solo') default NULL,
104   `solo` enum('trumpless','jack','queen','trump','club','spade','heart','silent') default NULL,
105   `sick_call` enum('true','false') default 'false',
106   `win_call` enum('true','false') default 'false',
107   `point_call` enum('90','60','30','0') default NULL,
108   UNIQUE KEY `id` (`id`)
109 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
110
111 --
112 -- Dumping data for table `Hand`
113 --
114
115
116 /*!40000 ALTER TABLE `Hand` DISABLE KEYS */;
117 LOCK TABLES `Hand` WRITE;
118 UNLOCK TABLES;
119 /*!40000 ALTER TABLE `Hand` ENABLE KEYS */;
120
121 --
122 -- Table structure for table `Hand_Card`
123 --
124
125 DROP TABLE IF EXISTS `Hand_Card`;
126 CREATE TABLE `Hand_Card` (
127   `id` int(11) NOT NULL auto_increment,
128   `hand_id` int(11) NOT NULL default '0',
129   `card_id` int(11) NOT NULL default '0',
130   `played` enum('true','false') default 'false',
131   UNIQUE KEY `id` (`id`)
132 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
133
134 --
135 -- Dumping data for table `Hand_Card`
136 --
137
138
139 /*!40000 ALTER TABLE `Hand_Card` DISABLE KEYS */;
140 LOCK TABLES `Hand_Card` WRITE;
141 UNLOCK TABLES;
142 /*!40000 ALTER TABLE `Hand_Card` ENABLE KEYS */;
143
144 --
145 -- Table structure for table `Play`
146 --
147
148 DROP TABLE IF EXISTS `Play`;
149 CREATE TABLE `Play` (
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   `id` int(11) NOT NULL auto_increment,
153   `trick_id` int(11) NOT NULL default '0',
154   `hand_card_id` int(11) NOT NULL default '0',
155   `sequence` tinyint(4) NOT NULL default '0',
156   UNIQUE KEY `id` (`id`)
157 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
158
159 --
160 -- Dumping data for table `Play`
161 --
162
163
164 /*!40000 ALTER TABLE `Play` DISABLE KEYS */;
165 LOCK TABLES `Play` WRITE;
166 UNLOCK TABLES;
167 /*!40000 ALTER TABLE `Play` ENABLE KEYS */;
168
169 --
170 -- Table structure for table `Score`
171 --
172
173 DROP TABLE IF EXISTS `Score`;
174 CREATE TABLE `Score` (
175   `id` int(11) NOT NULL auto_increment,
176   `game_id` int(11) NOT NULL default '0',
177   `hand_id` int(11) NOT NULL default '0',
178   `score` tinyint(4) default NULL,
179   UNIQUE KEY `id` (`id`)
180 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
181
182 --
183 -- Dumping data for table `Score`
184 --
185
186
187 /*!40000 ALTER TABLE `Score` DISABLE KEYS */;
188 LOCK TABLES `Score` WRITE;
189 UNLOCK TABLES;
190 /*!40000 ALTER TABLE `Score` ENABLE KEYS */;
191
192 --
193 -- Table structure for table `Trick`
194 --
195
196 DROP TABLE IF EXISTS `Trick`;
197 CREATE TABLE `Trick` (
198   `mod_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
199   `create_date` timestamp NOT NULL default '0000-00-00 00:00:00',
200   `id` int(11) NOT NULL auto_increment,
201   `game_id` int(11) NOT NULL default '0',
202   UNIQUE KEY `id` (`id`)
203 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
204
205 --
206 -- Dumping data for table `Trick`
207 --
208
209
210 /*!40000 ALTER TABLE `Trick` DISABLE KEYS */;
211 LOCK TABLES `Trick` WRITE;
212 UNLOCK TABLES;
213 /*!40000 ALTER TABLE `Trick` ENABLE KEYS */;
214
215 --
216 -- Table structure for table `User`
217 --
218
219 DROP TABLE IF EXISTS `User`;
220 CREATE TABLE `User` (
221   `id` int(11) NOT NULL auto_increment,
222   `fullname` varchar(64) default NULL,
223   `email` varchar(64) default NULL,
224   `password` varchar(32) default NULL,
225   `timezone` tinyint(2) default NULL,
226   `last_login` timestamp NOT NULL default '0000-00-00 00:00:00',
227   UNIQUE KEY `id` (`id`)
228 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
229
230 --
231 -- Dumping data for table `User`
232 --
233
234
235 /*!40000 ALTER TABLE `User` DISABLE KEYS */;
236 LOCK TABLES `User` WRITE;
237 UNLOCK TABLES;
238 /*!40000 ALTER TABLE `User` ENABLE KEYS */;
239
240 --
241 -- Table structure for table `User_Game_Prefs`
242 --
243
244 DROP TABLE IF EXISTS `User_Game_Prefs`;
245 CREATE TABLE `User_Game_Prefs` (
246   `id` int(11) NOT NULL auto_increment,
247   `user_id` int(11) NOT NULL default '0',
248   `game_id` int(11) NOT NULL default '0',
249   `pref_key` varchar(64) default NULL,
250   `value` varchar(64) default NULL,
251   UNIQUE KEY `id` (`id`)
252 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
253
254 --
255 -- Dumping data for table `User_Game_Prefs`
256 --
257
258
259 /*!40000 ALTER TABLE `User_Game_Prefs` DISABLE KEYS */;
260 LOCK TABLES `User_Game_Prefs` WRITE;
261 UNLOCK TABLES;
262 /*!40000 ALTER TABLE `User_Game_Prefs` ENABLE KEYS */;
263
264 --
265 -- Table structure for table `User_Prefs`
266 --
267
268 DROP TABLE IF EXISTS `User_Prefs`;
269 CREATE TABLE `User_Prefs` (
270   `id` int(11) NOT NULL auto_increment,
271   `user_id` int(11) NOT NULL default '0',
272   `pref_key` varchar(64) default NULL,
273   `value` varchar(64) default NULL,
274   UNIQUE KEY `id` (`id`)
275 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
276
277 --
278 -- Dumping data for table `User_Prefs`
279 --
280
281
282 /*!40000 ALTER TABLE `User_Prefs` DISABLE KEYS */;
283 LOCK TABLES `User_Prefs` WRITE;
284 UNLOCK TABLES;
285 /*!40000 ALTER TABLE `User_Prefs` ENABLE KEYS */;
286
287 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
288 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
289 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
290 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
291 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
292 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
293