-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdb.sql
378 lines (326 loc) · 15.7 KB
/
db.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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
-- MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
CREATE DATABASE `erepublik` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `erepublik`;
DROP TABLE IF EXISTS `article_votes`;
CREATE TABLE `article_votes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`article` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `article_uid` (`article`,`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `article_votes` (`id`, `article`, `uid`, `created_at`, `updated_at`) VALUES
(1, 1, 18, '2016-08-27 11:38:35', '2016-08-27 11:38:35'),
(2, 2, 18, '2016-09-06 17:16:50', '2016-09-06 17:16:50');
DROP TABLE IF EXISTS `candidate_votes`;
CREATE TABLE `candidate_votes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`candidate` int(11) NOT NULL,
`uid` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `chats`;
CREATE TABLE `chats` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`message` varchar(200) NOT NULL,
`sender` int(11) NOT NULL,
`channel_id` int(11) NOT NULL,
`channel_type` int(1) NOT NULL,
`likes` int(3) NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `chats` (`id`, `message`, `sender`, `channel_id`, `channel_type`, `likes`, `created_at`, `updated_at`) VALUES
(1, 'afsdfdsfsdfsdfsdf', 18, 1, 2, 0, '2016-08-28 15:07:28', '2016-08-28 15:07:28'),
(2, 'judas! traicionareo!!', 18, 1, 2, 0, '2016-08-28 15:37:16', '2016-08-28 15:37:16'),
(3, 'movimiento sesy!!movimiento sesy!!', 18, 1, 2, 0, '2016-08-28 15:42:43', '2016-08-28 15:42:43');
DROP TABLE IF EXISTS `companies`;
CREATE TABLE `companies` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`type` int(2) NOT NULL,
`quality` int(1) NOT NULL,
`last_work` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `companies` (`id`, `uid`, `type`, `quality`, `last_work`, `created_at`, `updated_at`) VALUES
(1, 18, 1, 1, '2016-08-28 14:29:47', '2016-08-11 16:20:06', '2016-08-28 14:29:47'),
(2, 18, 4, 1, '2016-08-28 14:29:47', '2016-08-11 16:21:00', '2016-08-28 14:29:47'),
(3, 18, 1, 2, '2016-08-28 14:29:47', '2016-08-12 18:01:46', '2016-08-28 14:29:47'),
(4, 18, 3, 1, '2016-08-28 14:29:47', '2016-08-16 17:37:33', '2016-08-28 14:29:47');
DROP TABLE IF EXISTS `congress_candidates`;
CREATE TABLE `congress_candidates` (
`uid` int(11) NOT NULL,
`yes` int(3) NOT NULL DEFAULT '0',
`no` int(3) NOT NULL DEFAULT '0',
`country` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `congress_members`;
CREATE TABLE `congress_members` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`party` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`country` int(3) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `congress_members` (`id`, `party`, `uid`, `country`, `created_at`, `updated_at`) VALUES
(1, 4, 18, 1, '2016-08-21 15:02:32', '2016-08-21 15:02:32');
DROP TABLE IF EXISTS `countries`;
CREATE TABLE `countries` (
`id` int(11) NOT NULL,
`name` varchar(110) NOT NULL,
`currency` varchar(20) NOT NULL,
`capital` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
KEY `id` (`id`),
KEY `capital` (`capital`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `countries` (`id`, `name`, `currency`, `capital`, `created_at`, `updated_at`) VALUES
(1, 'Spain', 'esp', 3, '2016-08-07 18:21:18', '2016-08-07 18:21:18');
DROP TABLE IF EXISTS `country_funds`;
CREATE TABLE `country_funds` (
`country` int(3) NOT NULL,
`gold` decimal(10,2) NOT NULL DEFAULT '0.00',
`esp` decimal(10,2) NOT NULL DEFAULT '0.00',
UNIQUE KEY `country` (`country`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `country_relations`;
CREATE TABLE `country_relations` (
`id` int(11) NOT NULL,
`country` int(3) NOT NULL,
`target` int(3) NOT NULL,
`relation` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `item_offers`;
CREATE TABLE `item_offers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`item` int(11) NOT NULL,
`quality` int(1) NOT NULL,
`uid` int(11) NOT NULL,
`price` decimal(10,2) NOT NULL,
`quantity` int(11) NOT NULL,
`country` int(5) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `item_offers` (`id`, `item`, `quality`, `uid`, `price`, `quantity`, `country`, `created_at`, `updated_at`) VALUES
(13, 1, 0, 18, 0.30, 206, 1, '2016-08-14 08:34:06', '2016-08-14 08:36:26'),
(14, 4, 1, 18, 0.10, 1000, 1, '2016-08-14 08:36:45', '2016-08-14 08:36:45');
DROP TABLE IF EXISTS `law_proposals`;
CREATE TABLE `law_proposals` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`type` int(2) NOT NULL,
`country` int(11) NOT NULL,
`reason` varchar(110) NOT NULL,
`target_country` int(11) NOT NULL DEFAULT '0',
`amount` float NOT NULL DEFAULT '0',
`yes` int(11) NOT NULL DEFAULT '0',
`no` int(11) NOT NULL DEFAULT '0',
`expected_votes` int(11) NOT NULL,
`finished` int(1) NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `law_proposals` (`id`, `uid`, `type`, `country`, `reason`, `target_country`, `amount`, `yes`, `no`, `expected_votes`, `finished`, `created_at`, `updated_at`) VALUES
(1, 18, 3, 1, 'We must increase it to steal more money', 0, 5.56, 0, 0, 1, 0, '2016-08-21 16:00:45', '2016-08-21 16:00:45'),
(2, 18, 3, 1, 'We must increase it to steal more money', 0, 5.56, 0, 0, 1, 0, '2016-08-21 16:01:26', '2016-08-21 16:01:26');
DROP TABLE IF EXISTS `law_votes`;
CREATE TABLE `law_votes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`law` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`in_favor` int(1) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `newspapers`;
CREATE TABLE `newspapers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(110) NOT NULL,
`country` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`description` varchar(200) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `newspapers` (`id`, `name`, `country`, `uid`, `description`, `created_at`, `updated_at`) VALUES
(2, 'El Noticiero', 1, 18, 'Para pasar el rato', '2016-08-27 09:44:08', '2016-08-27 09:44:08');
DROP TABLE IF EXISTS `newspaper_articles`;
CREATE TABLE `newspaper_articles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(110) NOT NULL,
`text` text NOT NULL,
`category` int(1) NOT NULL,
`uid` int(11) NOT NULL,
`country` int(11) NOT NULL,
`views` int(11) NOT NULL DEFAULT '0',
`votes` int(11) NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `newspaper_articles` (`id`, `title`, `text`, `category`, `uid`, `country`, `views`, `votes`, `created_at`, `updated_at`) VALUES
(1, 'Debes morir', '[center][size=6]Porque lo digo [b]yo[/b][/size][/center]\n\n[center][size=6][b][img]http://cdn.arstechnica.net/wp-content/uploads/2016/02/5718897981_10faa45ac3_b-640x624.jpg[/img][/b][/size][/center]\n', 1, 18, 1, 33, 1, '2016-08-27 11:09:23', '2016-09-06 17:13:06'),
(2, 'Congress declares WAR', '[center][img]http://www.army-technology.com/projects/ariete/images/ariete5.jpg[/img][/center]\n[center][b][size=7]Congress declares WAR[/size][/b][/center]\n\n[justify][color=#000000][size=2][font=\"Open Sans\", Arial, sans-serif]orem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eget augue eu ipsum molestie posuere. Ut ac ante ac odio aliquam pretium eget dictum arcu. Morbi malesuada consequat mattis. Suspendisse elementum volutpat justo, et malesuada dui posuere quis. Aliquam erat volutpat. Curabitur tristique lacinia elit, non sollicitudin orci pellentesque ut. Morbi lobortis erat quis eleifend ornare. Nunc eget fermentum neque. Interdum et malesuada fames ac ante ipsum primis in faucibus. In neque nisi, elementum scelerisque magna eget, mattis scelerisque urna. Ut congue ante at sapien dictum scelerisque. Duis sed ultricies lectus. Morbi ex nisl, facilisis vitae dolor in, facilisis tincidunt felis. Nulla in finibus dui. Integer fringilla quam vel aliquet faucibus. Ut ante eros, vehicula ut venenatis vel, gravida non quam.[/font][/size][/color][/justify]\n[justify][color=#000000][size=2][font=\"Open Sans\", Arial, sans-serif]Duis mollis accumsan risus, sit amet ornare lorem aliquet a. Fusce erat ante, elementum sit amet consequat in, imperdiet blandit risus. Maecenas hendrerit neque sit amet imperdiet tempor. Morbi sit amet pretium ante. Nulla facilisis eleifend diam a porta. Nulla condimentum quis ex vel mattis. Donec faucibus justo vitae scelerisque tempor. Duis est nisi, dignissim ut tempor id, suscipit ac lorem. In libero augue, euismod blandit nibh ut, molestie accumsan est. Donec molestie sed nibh non elementum. Aliquam pulvinar justo a tortor lobortis, id suscipit dui pulvinar. Phasellus vitae sapien sapien. Cras vulputate a tellus eget fermentum. Donec maximus massa dolor, mollis interdum neque efficitur quis. Pellentesque et ligula finibus, venenatis ligula et, rutrum nibh. Duis non maximus enim.[/font][/size][/color][/justify]\n[justify][color=#000000][size=2][font=\"Open Sans\", Arial, sans-serif]Suspendisse potenti. Pellentesque maximus sodales massa ut tempus. Curabitur at ultrices ante, vitae vestibulum nulla. Praesent ante orci, cursus non consectetur non, scelerisque euismod nisl. Donec sagittis molestie egestas. In mi nunc, auctor et aliquam vel, pharetra consequat lectus. Phasellus porttitor eget ligula id gravida. Etiam at libero efficitur, convallis eros vel, maximus lectus. Vivamus facilisis, ligula a dictum scelerisque, eros tellus pretium justo, pellentesque elementum nisi dolor non mauris. Interdum et malesuada fames ac ante ipsum primis in faucibus. Suspendisse tempus porta imperdiet.[/font][/size][/color][/justify]\n', 1, 18, 1, 2, 1, '2016-09-06 17:16:15', '2016-09-06 17:16:50');
DROP TABLE IF EXISTS `party_members`;
CREATE TABLE `party_members` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`party` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`level` int(1) NOT NULL DEFAULT '1',
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `party_members` (`id`, `party`, `uid`, `level`, `created_at`, `updated_at`) VALUES
(4, 4, 18, 3, '2016-08-16 15:52:26', '2016-08-16 15:52:26');
DROP TABLE IF EXISTS `political_parties`;
CREATE TABLE `political_parties` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`description` text NOT NULL,
`country` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `political_parties` (`id`, `uid`, `name`, `description`, `country`, `created_at`, `updated_at`) VALUES
(4, 18, 'Los traidores', 'Traicionar al país con todos los medios disponibles.', 1, '2016-08-16 15:52:26', '2016-08-16 15:52:26');
DROP TABLE IF EXISTS `regions`;
CREATE TABLE `regions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(110) NOT NULL,
`country` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `country` (`country`),
CONSTRAINT `regions_ibfk_1` FOREIGN KEY (`country`) REFERENCES `countries` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `regions` (`id`, `name`, `country`) VALUES
(3, 'Andalucia', 1),
(4, 'Aragon', 1),
(6, 'Balearic Islands', 1),
(7, 'Cantabria', 1),
(8, 'Castilla La Mancha', 1),
(9, 'Catalonia', 1),
(10, 'Extremadura', 1),
(11, 'Madrid', 1),
(12, 'Murcia', 1),
(13, 'Navarra', 1),
(14, 'Valencian Community', 1);
DROP TABLE IF EXISTS `region_connections`;
CREATE TABLE `region_connections` (
`region_a` int(11) NOT NULL,
`region_b` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
UNIQUE KEY `region_a_region_b` (`region_a`,`region_b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `taxes`;
CREATE TABLE `taxes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` int(2) NOT NULL,
`amount` float NOT NULL,
`country` int(3) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nick` varchar(100) NOT NULL,
`email` varchar(150) NOT NULL,
`password` varchar(150) NOT NULL,
`status` int(1) NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL,
`level` int(3) NOT NULL DEFAULT '1',
`xp` int(11) NOT NULL DEFAULT '0',
`strength` int(11) NOT NULL DEFAULT '1',
`region` int(11) NOT NULL,
`referrer` int(11) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`),
UNIQUE KEY `nick` (`nick`),
KEY `region` (`region`),
KEY `referrer` (`referrer`),
CONSTRAINT `users_ibfk_1` FOREIGN KEY (`region`) REFERENCES `regions` (`id`),
CONSTRAINT `users_ibfk_2` FOREIGN KEY (`referrer`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `users` (`id`, `nick`, `email`, `password`, `status`, `created_at`, `level`, `xp`, `strength`, `region`, `referrer`, `updated_at`) VALUES
(18, 'admin', '[email protected]', 'd63be78cdd3bcfe1df97b5b3acbc752d', 1, '2016-08-07 18:34:41', 1, 0, 31, 3, NULL, '2016-08-28 14:14:29');
DROP TABLE IF EXISTS `user_gyms`;
CREATE TABLE `user_gyms` (
`uid` int(11) NOT NULL,
`q1` datetime DEFAULT NULL,
`q2` datetime DEFAULT NULL,
`q3` datetime DEFAULT NULL,
`q4` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `user_gyms` (`uid`, `q1`, `q2`, `q3`, `q4`) VALUES
(18, '2016-08-28 00:00:00', '2016-08-18 00:00:00', NULL, NULL);
DROP TABLE IF EXISTS `user_items`;
CREATE TABLE `user_items` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`item` int(11) NOT NULL,
`quality` int(1) NOT NULL DEFAULT '0',
`quantity` float NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `uid_item_quality` (`uid`,`item`,`quality`),
KEY `uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `user_items` (`id`, `uid`, `item`, `quality`, `quantity`) VALUES
(1, 18, 1, 0, 1023),
(2, 18, 4, 1, 479),
(3, 18, 1, 2, 70),
(4, 18, 1, 1, 30),
(5, 18, 3, 1, 30),
(6, 18, 3, 0, 30);
DROP TABLE IF EXISTS `user_money`;
CREATE TABLE `user_money` (
`uid` int(11) NOT NULL,
`gold` decimal(11,2) NOT NULL DEFAULT '0.00',
`esp` decimal(11,2) NOT NULL DEFAULT '0.00',
UNIQUE KEY `uid` (`uid`),
CONSTRAINT `user_money_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `user_money` (`uid`, `gold`, `esp`) VALUES
(18, 60.00, 4800.00);
DROP TABLE IF EXISTS `work_offers`;
CREATE TABLE `work_offers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`company` int(11) NOT NULL,
`salary` decimal(10,2) NOT NULL DEFAULT '1000.00',
`country` int(11) NOT NULL,
`worker` int(11) DEFAULT NULL,
`last_work` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `worker` (`worker`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- 2016-09-25 15:07:10