· 9 years ago · Dec 25, 2016, 07:12 AM
1/*
2Navicat MySQL Data Transfer
3
4Source Server : Local Database
5Source Server Version : 50714
6Source Host : localhost:3306
7Source Database : afterlife
8
9Target Server Type : MYSQL
10Target Server Version : 50714
11File Encoding : 65001
12
13Date: 2016-09-14 21:48:03
14*/
15
16SET FOREIGN_KEY_CHECKS=0;
17
18-- ----------------------------
19-- Table structure for account
20-- ----------------------------
21DROP TABLE IF EXISTS `account`;
22CREATE TABLE `account` (
23 `uid` varchar(32) NOT NULL,
24 `clan_id` int(11) unsigned DEFAULT NULL,
25 `name` varchar(64) NOT NULL,
26 `score` int(11) NOT NULL DEFAULT '0',
27 `kills` int(11) unsigned NOT NULL DEFAULT '0',
28 `deaths` int(11) unsigned NOT NULL DEFAULT '0',
29 `locker` int(11) NOT NULL DEFAULT '0',
30 `first_connect_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
31 `last_connect_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
32 `last_disconnect_at` datetime DEFAULT NULL,
33 `total_connections` int(11) unsigned NOT NULL DEFAULT '1',
34 PRIMARY KEY (`uid`),
35 KEY `clan_id` (`clan_id`),
36 CONSTRAINT `account_ibfk_1` FOREIGN KEY (`clan_id`) REFERENCES `clan` (`id`) ON DELETE SET NULL
37) ENGINE=InnoDB DEFAULT CHARSET=utf8;
38
39-- ----------------------------
40-- Records of account
41-- ----------------------------
42
43-- ----------------------------
44-- Table structure for clan
45-- ----------------------------
46DROP TABLE IF EXISTS `clan`;
47CREATE TABLE `clan` (
48 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
49 `name` varchar(64) NOT NULL,
50 `leader_uid` varchar(32) NOT NULL,
51 `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
52 PRIMARY KEY (`id`),
53 KEY `leader_uid` (`leader_uid`),
54 CONSTRAINT `clan_ibfk_1` FOREIGN KEY (`leader_uid`) REFERENCES `account` (`uid`) ON DELETE CASCADE
55) ENGINE=InnoDB DEFAULT CHARSET=utf8;
56
57-- ----------------------------
58-- Records of clan
59-- ----------------------------
60
61-- ----------------------------
62-- Table structure for clan_map_marker
63-- ----------------------------
64DROP TABLE IF EXISTS `clan_map_marker`;
65CREATE TABLE `clan_map_marker` (
66 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
67 `clan_id` int(11) unsigned NOT NULL,
68 `markerType` tinyint(4) NOT NULL DEFAULT '-1',
69 `positionArr` text NOT NULL,
70 `color` varchar(255) NOT NULL,
71 `icon` varchar(255) NOT NULL,
72 `iconSize` float unsigned NOT NULL,
73 `label` varchar(255) NOT NULL,
74 `labelSize` float unsigned NOT NULL,
75 PRIMARY KEY (`id`),
76 KEY `clan_id` (`clan_id`),
77 CONSTRAINT `clan_map_marker_ibfk_1` FOREIGN KEY (`clan_id`) REFERENCES `clan` (`id`) ON DELETE CASCADE
78) ENGINE=InnoDB DEFAULT CHARSET=utf8;
79
80-- ----------------------------
81-- Records of clan_map_marker
82-- ----------------------------
83
84-- ----------------------------
85-- Table structure for construction
86-- ----------------------------
87DROP TABLE IF EXISTS `construction`;
88CREATE TABLE `construction` (
89 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
90 `class` varchar(64) NOT NULL,
91 `account_uid` varchar(32) NOT NULL,
92 `spawned_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
93 `position_x` double NOT NULL DEFAULT '0',
94 `position_y` double NOT NULL DEFAULT '0',
95 `position_z` double NOT NULL DEFAULT '0',
96 `direction_x` double NOT NULL DEFAULT '0',
97 `direction_y` double NOT NULL DEFAULT '0',
98 `direction_z` double NOT NULL DEFAULT '0',
99 `up_x` double NOT NULL DEFAULT '0',
100 `up_y` double NOT NULL DEFAULT '0',
101 `up_z` double NOT NULL DEFAULT '0',
102 `is_locked` tinyint(1) NOT NULL DEFAULT '0',
103 `pin_code` varchar(6) NOT NULL DEFAULT '000000',
104 `damage` tinyint(1) unsigned DEFAULT '0',
105 `territory_id` int(11) unsigned DEFAULT NULL,
106 `last_updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
107 `deleted_at` datetime DEFAULT NULL,
108 PRIMARY KEY (`id`),
109 KEY `account_uid` (`account_uid`),
110 KEY `territory_id` (`territory_id`),
111 CONSTRAINT `construction_ibfk_1` FOREIGN KEY (`account_uid`) REFERENCES `account` (`uid`) ON DELETE CASCADE,
112 CONSTRAINT `construction_ibfk_2` FOREIGN KEY (`territory_id`) REFERENCES `territory` (`id`) ON DELETE CASCADE
113) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
114
115-- ----------------------------
116-- Records of construction
117-- ----------------------------
118
119-- ----------------------------
120-- Table structure for container
121-- ----------------------------
122DROP TABLE IF EXISTS `container`;
123CREATE TABLE `container` (
124 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
125 `class` varchar(64) NOT NULL,
126 `spawned_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
127 `account_uid` varchar(32) DEFAULT NULL,
128 `is_locked` tinyint(1) NOT NULL DEFAULT '0',
129 `position_x` double NOT NULL DEFAULT '0',
130 `position_y` double NOT NULL DEFAULT '0',
131 `position_z` double NOT NULL DEFAULT '0',
132 `direction_x` double NOT NULL DEFAULT '0',
133 `direction_y` double NOT NULL DEFAULT '0',
134 `direction_z` double NOT NULL DEFAULT '0',
135 `up_x` double NOT NULL DEFAULT '0',
136 `up_y` double NOT NULL DEFAULT '0',
137 `up_z` double NOT NULL DEFAULT '1',
138 `cargo_items` text NOT NULL,
139 `cargo_magazines` text NOT NULL,
140 `cargo_weapons` text NOT NULL,
141 `cargo_container` text NOT NULL,
142 `last_updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
143 `pin_code` varchar(6) NOT NULL DEFAULT '000000',
144 `territory_id` int(11) unsigned DEFAULT NULL,
145 `deleted_at` datetime DEFAULT NULL,
146 `money` int(11) unsigned NOT NULL DEFAULT '0',
147 `abandoned` datetime DEFAULT NULL,
148 PRIMARY KEY (`id`),
149 KEY `account_uid` (`account_uid`),
150 KEY `territory_id` (`territory_id`),
151 CONSTRAINT `container_ibfk_1` FOREIGN KEY (`account_uid`) REFERENCES `account` (`uid`) ON DELETE CASCADE,
152 CONSTRAINT `container_ibfk_2` FOREIGN KEY (`territory_id`) REFERENCES `territory` (`id`) ON DELETE CASCADE
153) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
154
155-- ----------------------------
156-- Records of container
157-- ----------------------------
158
159-- ----------------------------
160-- Table structure for environment
161-- ----------------------------
162DROP TABLE IF EXISTS `environment`;
163CREATE TABLE `environment` (
164 `serverID` varchar(4) NOT NULL,
165 `date` text NOT NULL,
166 `weather` text NOT NULL,
167 `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
168 `last_updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
169 PRIMARY KEY (`serverID`),
170 KEY `serverID` (`serverID`)
171) ENGINE=InnoDB DEFAULT CHARSET=utf8;
172
173-- ----------------------------
174-- Records of environment
175-- ----------------------------
176
177-- ----------------------------
178-- Table structure for listing
179-- ----------------------------
180DROP TABLE IF EXISTS `listing`;
181CREATE TABLE `listing` (
182 `listingID` varchar(8) NOT NULL,
183 `itemAvailable` tinyint(1) NOT NULL DEFAULT '1',
184 `itemArray` text NOT NULL,
185 `price` double NOT NULL,
186 `sellerUID` varchar(64) NOT NULL,
187 `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
188 PRIMARY KEY (`listingID`),
189 KEY `listingID` (`listingID`)
190) ENGINE=InnoDB DEFAULT CHARSET=utf8;
191
192-- ----------------------------
193-- Records of listing
194-- ----------------------------
195
196-- ----------------------------
197-- Table structure for player
198-- ----------------------------
199DROP TABLE IF EXISTS `player`;
200CREATE TABLE `player` (
201 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
202 `name` varchar(64) NOT NULL,
203 `account_uid` varchar(32) NOT NULL,
204 `money` int(11) unsigned NOT NULL DEFAULT '0',
205 `damage` double unsigned NOT NULL DEFAULT '0',
206 `hunger` double unsigned NOT NULL DEFAULT '100',
207 `thirst` double unsigned NOT NULL DEFAULT '100',
208 `alcohol` double unsigned NOT NULL DEFAULT '0',
209 `temperature` double NOT NULL DEFAULT '37',
210 `wetness` double unsigned NOT NULL DEFAULT '0',
211 `oxygen_remaining` double unsigned NOT NULL DEFAULT '1',
212 `bleeding_remaining` double unsigned NOT NULL DEFAULT '0',
213 `hitpoints` varchar(255) NOT NULL DEFAULT '[]',
214 `direction` double NOT NULL DEFAULT '0',
215 `position_x` double NOT NULL DEFAULT '0',
216 `position_y` double NOT NULL DEFAULT '0',
217 `position_z` double NOT NULL DEFAULT '0',
218 `spawned_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
219 `assigned_items` text NOT NULL,
220 `backpack` varchar(64) NOT NULL,
221 `backpack_items` text NOT NULL,
222 `backpack_magazines` text NOT NULL,
223 `backpack_weapons` text NOT NULL,
224 `current_weapon` varchar(64) NOT NULL,
225 `goggles` varchar(64) NOT NULL,
226 `handgun_items` text NOT NULL,
227 `handgun_weapon` varchar(64) NOT NULL,
228 `headgear` varchar(64) NOT NULL,
229 `binocular` varchar(64) NOT NULL,
230 `loaded_magazines` text NOT NULL,
231 `primary_weapon` varchar(64) NOT NULL,
232 `primary_weapon_items` text NOT NULL,
233 `secondary_weapon` varchar(64) NOT NULL,
234 `secondary_weapon_items` text NOT NULL,
235 `uniform` varchar(64) NOT NULL,
236 `uniform_items` text NOT NULL,
237 `uniform_magazines` text NOT NULL,
238 `uniform_weapons` text NOT NULL,
239 `vest` varchar(64) NOT NULL,
240 `vest_items` text NOT NULL,
241 `vest_magazines` text NOT NULL,
242 `vest_weapons` text NOT NULL,
243 `last_updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
244 PRIMARY KEY (`id`),
245 KEY `player_uid` (`account_uid`),
246 CONSTRAINT `player_ibfk_1` FOREIGN KEY (`account_uid`) REFERENCES `account` (`uid`) ON DELETE CASCADE
247) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8;
248
249-- ----------------------------
250-- Records of player
251-- ----------------------------
252
253-- ----------------------------
254-- Table structure for player_history
255-- ----------------------------
256DROP TABLE IF EXISTS `player_history`;
257CREATE TABLE `player_history` (
258 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
259 `account_uid` varchar(32) NOT NULL,
260 `name` varchar(64) NOT NULL,
261 `died_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
262 `position_x` double NOT NULL,
263 `position_y` double NOT NULL,
264 `position_z` double NOT NULL,
265 PRIMARY KEY (`id`)
266) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8;
267
268-- ----------------------------
269-- Records of player_history
270-- ----------------------------
271
272-- ----------------------------
273-- Table structure for territory
274-- ----------------------------
275DROP TABLE IF EXISTS `territory`;
276CREATE TABLE `territory` (
277 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
278 `owner_uid` varchar(32) NOT NULL,
279 `name` varchar(64) NOT NULL,
280 `position_x` double NOT NULL,
281 `position_y` double NOT NULL,
282 `position_z` double NOT NULL,
283 `radius` double NOT NULL,
284 `level` int(11) NOT NULL,
285 `flag_texture` varchar(255) NOT NULL,
286 `flag_stolen` tinyint(1) NOT NULL DEFAULT '0',
287 `flag_stolen_by_uid` varchar(32) DEFAULT NULL,
288 `flag_stolen_at` datetime DEFAULT NULL,
289 `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
290 `last_paid_at` datetime DEFAULT CURRENT_TIMESTAMP,
291 `xm8_protectionmoney_notified` tinyint(1) NOT NULL DEFAULT '0',
292 `build_rights` varchar(640) NOT NULL DEFAULT '0',
293 `moderators` varchar(320) NOT NULL DEFAULT '0',
294 `deleted_at` datetime DEFAULT NULL,
295 PRIMARY KEY (`id`),
296 KEY `owner_uid` (`owner_uid`),
297 KEY `flag_stolen_by_uid` (`flag_stolen_by_uid`),
298 CONSTRAINT `territory_ibfk_1` FOREIGN KEY (`owner_uid`) REFERENCES `account` (`uid`) ON DELETE CASCADE,
299 CONSTRAINT `territory_ibfk_2` FOREIGN KEY (`flag_stolen_by_uid`) REFERENCES `account` (`uid`) ON DELETE SET NULL
300) ENGINE=InnoDB DEFAULT CHARSET=utf8;
301
302-- ----------------------------
303-- Records of territory
304-- ----------------------------
305
306-- ----------------------------
307-- Table structure for vehicle
308-- ----------------------------
309DROP TABLE IF EXISTS `vehicle`;
310CREATE TABLE `vehicle` (
311 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
312 `class` varchar(64) NOT NULL,
313 `spawned_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
314 `account_uid` varchar(32) DEFAULT NULL,
315 `is_locked` tinyint(1) NOT NULL DEFAULT '0',
316 `fuel` double unsigned NOT NULL DEFAULT '0',
317 `damage` double unsigned NOT NULL DEFAULT '0',
318 `hitpoints` text NOT NULL,
319 `position_x` double NOT NULL DEFAULT '0',
320 `position_y` double NOT NULL DEFAULT '0',
321 `position_z` double NOT NULL DEFAULT '0',
322 `direction_x` double NOT NULL DEFAULT '0',
323 `direction_y` double NOT NULL DEFAULT '0',
324 `direction_z` double NOT NULL DEFAULT '0',
325 `up_x` double NOT NULL DEFAULT '0',
326 `up_y` double NOT NULL DEFAULT '0',
327 `up_z` double NOT NULL DEFAULT '1',
328 `cargo_items` text NOT NULL,
329 `cargo_magazines` text NOT NULL,
330 `cargo_weapons` text NOT NULL,
331 `cargo_container` text NOT NULL,
332 `last_updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
333 `pin_code` varchar(6) NOT NULL DEFAULT '000000',
334 `deleted_at` datetime DEFAULT NULL,
335 `money` int(11) unsigned NOT NULL DEFAULT '0',
336 `vehicle_texture` text NOT NULL,
337 PRIMARY KEY (`id`),
338 KEY `account_uid` (`account_uid`),
339 CONSTRAINT `vehicle_ibfk_1` FOREIGN KEY (`account_uid`) REFERENCES `account` (`uid`) ON DELETE CASCADE
340) ENGINE=InnoDB DEFAULT CHARSET=utf8;
341
342-- ----------------------------
343-- Records of vehicle
344-- ----------------------------
345SET FOREIGN_KEY_CHECKS=1;