-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtophat.sql
254 lines (184 loc) · 6.99 KB
/
tophat.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# ************************************************************
# Sequel Pro SQL dump
# Version 3408
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 127.0.0.1 (MySQL 5.1.63)
# Database: tophat
# Generation Time: 2012-08-21 13:57:07 +0000
# ************************************************************
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!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' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Dump of table api_keys
# ------------------------------------------------------------
DROP TABLE IF EXISTS `api_keys`;
CREATE TABLE `api_keys` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`key` char(64) NOT NULL,
`group_id` smallint(5) unsigned NOT NULL,
`user_id` mediumint(8) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `key` (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table game_types
# ------------------------------------------------------------
DROP TABLE IF EXISTS `game_types`;
CREATE TABLE `game_types` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`name` char(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table games
# ------------------------------------------------------------
DROP TABLE IF EXISTS `games`;
CREATE TABLE `games` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`name` char(255) NOT NULL,
`game_type_id` smallint(5) unsigned NOT NULL,
`creator` mediumint(8) unsigned NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`start_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`end_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `creator` (`creator`),
FULLTEXT KEY `name_ft` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table games_meta
# ------------------------------------------------------------
DROP TABLE IF EXISTS `games_meta`;
CREATE TABLE `games_meta` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`game_id` mediumint(8) unsigned NOT NULL,
`key` char(30) NOT NULL,
`value` text,
PRIMARY KEY (`id`),
UNIQUE KEY `key_game_id` (`key`,`game_id`),
KEY `game_id` (`game_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table group_perms
# ------------------------------------------------------------
DROP TABLE IF EXISTS `group_perms`;
CREATE TABLE `group_perms` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`group_id` smallint(5) unsigned NOT NULL,
`perm_id` mediumint(8) unsigned NOT NULL,
`value` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `group_id` (`group_id`),
KEY `perm_id` (`perm_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table groups
# ------------------------------------------------------------
DROP TABLE IF EXISTS `groups`;
CREATE TABLE `groups` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`name` char(128) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table kills
# ------------------------------------------------------------
DROP TABLE IF EXISTS `kills`;
CREATE TABLE `kills` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`killer_player_id` mediumint(8) NOT NULL,
`victim_player_id` mediumint(8) NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`verified` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `killer_user_id` (`killer_player_id`),
KEY `victim_usr_id` (`victim_player_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table perms
# ------------------------------------------------------------
DROP TABLE IF EXISTS `perms`;
CREATE TABLE `perms` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
`key` char(25) NOT NULL,
`name` char(45) NOT NULL,
PRIMARY KEY (`id`),
KEY `key` (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table players
# ------------------------------------------------------------
DROP TABLE IF EXISTS `players`;
CREATE TABLE `players` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`name` char(60) DEFAULT NULL,
`photo` char(32) DEFAULT NULL,
`game_id` mediumint(8) unsigned NOT NULL,
`user_id` mediumint(8) unsigned NOT NULL,
`lat` float(10,6) DEFAULT NULL,
`lon` float(10,6) DEFAULT NULL,
`score` smallint(5) DEFAULT '0',
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `game_id` (`game_id`),
KEY `user_id` (`user_id`),
KEY `lat` (`lat`),
KEY `lon` (`lon`),
FULLTEXT KEY `name_ft` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table players_meta
# ------------------------------------------------------------
DROP TABLE IF EXISTS `players_meta`;
CREATE TABLE `players_meta` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`player_id` mediumint(8) unsigned NOT NULL,
`key` char(30) NOT NULL,
`value` text,
PRIMARY KEY (`id`),
UNIQUE KEY `key_player_id` (`player_id`,`key`),
KEY `player_id` (`player_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table user_games
# ------------------------------------------------------------
DROP TABLE IF EXISTS `user_games`;
CREATE TABLE `user_games` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`user_id` mediumint(8) unsigned NOT NULL,
`game_id` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `game_id` (`game_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table users
# ------------------------------------------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`name` char(60) NOT NULL DEFAULT '',
`photo` char(32) DEFAULT NULL,
`email` char(255) DEFAULT '',
`password` char(69) DEFAULT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`registered` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`),
UNIQUE KEY `password` (`password`),
FULLTEXT KEY `name_ft` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table users_meta
# ------------------------------------------------------------
DROP TABLE IF EXISTS `users_meta`;
CREATE TABLE `users_meta` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` mediumint(8) unsigned NOT NULL,
`key` char(30) NOT NULL,
`value` text NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `key_user_id` (`key`,`user_id`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;