-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuno.sql
More file actions
525 lines (422 loc) · 14.8 KB
/
uno.sql
File metadata and controls
525 lines (422 loc) · 14.8 KB
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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
--
-- PostgreSQL database dump
--
-- Dumped from database version 14.0
-- Dumped by pg_dump version 14.0
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: players; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.players (
userid integer NOT NULL,
username character varying(45) NOT NULL,
email character varying(255) NOT NULL,
password character varying(255) NOT NULL,
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
profileicon character varying(255) DEFAULT 'bird'::character varying NOT NULL
);
ALTER TABLE public.players OWNER TO postgres;
--
-- Name: players_userid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.players_userid_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.players_userid_seq OWNER TO postgres;
--
-- Name: players_userid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.players_userid_seq OWNED BY public.players.userid;
--
-- Name: uno_cards; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.uno_cards (
card_id integer NOT NULL,
color character varying(45) NOT NULL,
"values" numeric NOT NULL,
image_file character varying(255) NOT NULL
);
ALTER TABLE public.uno_cards OWNER TO postgres;
--
-- Name: uno_cards_card_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.uno_cards_card_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.uno_cards_card_id_seq OWNER TO postgres;
--
-- Name: uno_cards_card_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.uno_cards_card_id_seq OWNED BY public.uno_cards.card_id;
--
-- Name: uno_effects; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.uno_effects (
effectid integer NOT NULL,
uno_values numeric NOT NULL,
effect character varying(145) NOT NULL
);
ALTER TABLE public.uno_effects OWNER TO postgres;
--
-- Name: uno_effects_effectid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.uno_effects_effectid_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.uno_effects_effectid_seq OWNER TO postgres;
--
-- Name: uno_effects_effectid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.uno_effects_effectid_seq OWNED BY public.uno_effects.effectid;
--
-- Name: uno_leaderboard; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.uno_leaderboard (
id SERIAL PRIMARY KEY,
userid INTEGER NOT NULL REFERENCES players(userid),
score INTEGER NOT NULL DEFAULT 0,
game_status INTEGER NOT NULL DEFAULT 0,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
ALTER TABLE public.uno_leaderboard OWNER TO postgres;
--
-- Name: uno_leaderboard_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.uno_leaderboard_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.uno_leaderboard_id_seq OWNER TO postgres;
--
-- Name: uno_leaderboard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.uno_leaderboard_id_seq OWNED BY public.uno_leaderboard.id;
--
-- Name: players userid; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.players ALTER COLUMN userid SET DEFAULT nextval('public.players_userid_seq'::regclass);
--
-- Name: uno_cards card_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.uno_cards ALTER COLUMN card_id SET DEFAULT nextval('public.uno_cards_card_id_seq'::regclass);
--
-- Name: uno_effects effectid; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.uno_effects ALTER COLUMN effectid SET DEFAULT nextval('public.uno_effects_effectid_seq'::regclass);
--
-- Name: uno_leaderboard id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.uno_leaderboard ALTER COLUMN id SET DEFAULT nextval('public.uno_leaderboard_id_seq'::regclass);
--
-- Data for Name: players; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.players (userid, username, email, password, created_at, profileicon) FROM stdin;
17 t3 t3@gmail.com $2b$10$nx1gimQUduev11T/SocEde5JqeXEnT1/Gj/jqzBCvqlhBaOiaiDGe 2021-11-15 11:32:44.202216 bird
26 t11 t11@gmail.com $2b$10$mxfVRYC5b5jlV87rqnnIaO7b/WJz3ADnP.OReW5.eu/Le4qCM3DvO 2021-11-16 00:46:45.855368 bird
27 t2 t2@gmail.com $2b$10$UiJgTTntkPk9CPDFu3Kn2O5XyxMVOAzLwkX/V4BtTwXM3epkyINwy 2021-11-16 00:48:55.012633 bird
28 t4 t4@gmail.com $2b$10$uz5fs0L8Is52RAnmJ5VOie/sB2LxgNqR2mxBfds7jtNAMCCP/MiI6 2021-11-16 00:49:01.538011 bird
29 t5 t5@gmail.com $2b$10$nCfuu0OIAqMVxscX.gFzFubFH3TTzvSECFnMpzJxwmc8hfAVgDbE2 2021-11-16 00:49:08.859845 bird
30 t6 t6@gmail.com $2b$10$chGxCyEpnpZIzUdoIp72HezFiRI/ES.xcN1uXb7XmUX9LhUnXmfgq 2021-11-16 00:49:13.195443 bird
31 t7 t7@gmail.com $2b$10$uiD09YkoWR7fkFyVGYjetOXVO2o6bh9U9hT9Mw2XFn./XrkhyIfOW 2021-11-16 00:49:17.39844 bird
15 t1 t1@gmail.com $2b$10$EyDipLAUDFbyxnKMGn68G.Uzm1.qisY1dH/sDp/R8Oa/Lj8t7K9ue 2021-11-15 11:32:27.967318 shell
32 a1 a1@gmail.com $2b$10$1uSjSr1R1Wqmy8mk0W8V7O.rZTLkT2cgem6yqH0pqTpQHyNoMAT7a 2021-11-26 16:29:45.100289 bird
33 newname a2@gmail.com $2b$10$xB0EczHhQzNrvglq.3AuIe1KG54kA66PL.xP/xolnfdrT4T7r6smm 2021-11-26 16:31:23.30327 turtle
\.
INSERT INTO
players
(username, email, password, googleId, created_at, profileicon)
VALUES
('t3', 't3@gmail.com', '$2b$10$nx1gimQUduev11T/SocEde5JqeXEnT1/Gj/jqzBCvqlhBaOiaiDGe', null, '2021-11-15 11:32:44.202216', 'bird'),
('t11', 't11@gmail.com', '$2b$10$mxfVRYC5b5jlV87rqnnIaO7b/WJz3ADnP.OReW5.eu/Le4qCM3DvO', null, '2021-11-16 00:46:45.855368', 'bird'),
('t2', 't2@gmail.com', '$2b$10$UiJgTTntkPk9CPDFu3Kn2O5XyxMVOAzLwkX/V4BtTwXM3epkyINwy', null, '2021-11-16 00:48:55.012633', 'shell'),
('t4', 't4@gmail.com', '$2b$10$uz5fs0L8Is52RAnmJ5VOie/sB2LxgNqR2mxBfds7jtNAMCCP/MiI6', null, '2021-11-16 00:49:01.538011', 'bird'),
('t5', 't5@gmail.com', '$2b$10$nCfuu0OIAqMVxscX.gFzFubFH3TTzvSECFnMpzJxwmc8hfAVgDbE2', null, '2021-11-16 00:49:08.859845', 'shell'),
('t6', 't6@gmail.com', '$2b$10$chGxCyEpnpZIzUdoIp72HezFiRI/ES.xcN1uXb7XmUX9LhUnXmfgq', null, '2021-11-16 00:49:13.195443', 'bird'),
('t7', 't7@gmail.com', '$2b$10$uiD09YkoWR7fkFyVGYjetOXVO2o6bh9U9hT9Mw2XFn./XrkhyIfOW', null, '2021-11-16 00:49:17.39844', 'bird'),
('t1', 't1@gmail.com', '$2b$10$EyDipLAUDFbyxnKMGn68G.Uzm1.qisY1dH/sDp/R8Oa/Lj8t7K9ue', null, '2021-11-15 11:32:27.967318', 'shell'),
('a1', 'a1@gmail.com', '$2b$10$1uSjSr1R1Wqmy8mk0W8V7O.rZTLkT2cgem6yqH0pqTpQHyNoMAT7a', null, '2021-11-26 16:29:45.100289', 'bird'),
('newname', 'a2@gmail.com', '$2b$10$xB0EczHhQzNrvglq.3AuIe1KG54kA66PL.xP/xolnfdrT4T7r6smm', null, '2021-11-26 16:31:23.30327', 'turtle');
--
-- Data for Name: uno_cards; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.uno_cards (card_id, color, "values", image_file) FROM stdin;
0 red 0 ./cards/Red_0.png
1 red 1 ./cards/Red_1.png
2 red 2 ./cards/Red_2.png
3 red 3 ./cards/Red_3.png
4 red 4 ./cards/Red_4.png
5 red 5 ./cards/Red_5.png
6 red 6 ./cards/Red_6.png
7 red 7 ./cards/Red_7.png
8 red 8 ./cards/Red_8.png
9 red 9 ./cards/Red_9.png
10 red 10 ./cards/Red_Skip.png
11 red 11 ./cards/Red_Reverse.png
12 red 12 ./cards/Red_Draw.png
13 red 1 ./cards/Red_1.png
14 red 2 ./cards/Red_2.png
15 red 3 ./cards/Red_3.png
16 red 4 ./cards/Red_4.png
17 red 5 ./cards/Red_5.png
18 red 6 ./cards/Red_6.png
19 red 7 ./cards/Red_7.png
20 red 8 ./cards/Red_8.png
21 red 9 ./cards/Red_9.png
22 red 10 ./cards/Red_Skip.png
23 red 11 ./cards/Red_Reverse.png
24 red 12 ./cards/Red_Draw.png
25 wild 13 ./cards/Wild.png
26 wild 14 ./cards/Wild_Draw.png
27 wild 13 ./cards/Wild.png
28 wild 14 ./cards/Wild_Draw.png
29 wild 13 ./cards/Wild.png
30 wild 14 ./cards/Wild_Draw.png
31 wild 13 ./cards/Wild.png
32 wild 14 ./cards/Wild_Draw.png
33 blue 0 ./cards/Blue_0.png
34 blue 1 ./cards/Blue_1.png
35 blue 2 ./cards/Blue_2.png
36 blue 3 ./cards/Blue_3.png
37 blue 4 ./cards/Blue_4.png
38 blue 5 ./cards/Blue_5.png
39 blue 6 ./cards/Blue_6.png
40 blue 7 ./cards/Blue_7.png
41 blue 8 ./cards/Blue_8.png
42 blue 9 ./cards/Blue_9.png
43 blue 10 ./cards/Blue_Skip.png
44 blue 11 ./cards/Blue_Reverse.png
45 blue 12 ./cards/Blue_Draw.png
46 blue 1 ./cards/Blue_1.png
47 blue 2 ./cards/Blue_2.png
48 blue 3 ./cards/Blue_3.png
49 blue 4 ./cards/Blue_4.png
50 blue 5 ./cards/Blue_5.png
51 blue 6 ./cards/Blue_6.png
52 blue 7 ./cards/Blue_7.png
53 blue 8 ./cards/Blue_8.png
54 blue 9 ./cards/Blue_9.png
55 blue 10 ./cards/Blue_Skip.png
56 blue 11 ./cards/Blue_Reverse.png
57 blue 12 ./cards/Blue_Draw.png
58 green 0 ./cards/Green_0.png
59 green 1 ./cards/Green_1.png
60 green 2 ./cards/Green_2.png
61 green 3 ./cards/Green_3.png
62 green 4 ./cards/Green_4.png
63 green 5 ./cards/Green_5.png
64 green 6 ./cards/Green_6.png
65 green 7 ./cards/Green_7.png
66 green 8 ./cards/Green_8.png
67 green 9 ./cards/Green_9.png
68 green 10 ./cards/Green_Skip.png
69 green 11 ./cards/Green_Reverse.png
70 green 12 ./cards/Green_Draw.png
71 green 1 ./cards/Green_1.png
72 green 2 ./cards/Green_2.png
73 green 3 ./cards/Green_3.png
74 green 4 ./cards/Green_4.png
75 green 5 ./cards/Green_5.png
76 green 6 ./cards/Green_6.png
77 green 7 ./cards/Green_7.png
78 green 8 ./cards/Green_8.png
79 green 9 ./cards/Green_9.png
80 green 10 ./cards/Green_Skip.png
81 green 11 ./cards/Green_Reverse.png
82 green 12 ./cards/Green_Draw.png
83 yellow 0 ./cards/Yellow_0.png
84 yellow 1 ./cards/Yellow_1.png
85 yellow 2 ./cards/Yellow_2.png
86 yellow 3 ./cards/Yellow_3.png
87 yellow 4 ./cards/Yellow_4.png
88 yellow 5 ./cards/Yellow_5.png
89 yellow 6 ./cards/Yellow_6.png
90 yellow 7 ./cards/Yellow_7.png
91 yellow 8 ./cards/Yellow_8.png
92 yellow 9 ./cards/Yellow_9.png
93 yellow 10 ./cards/Yellow_Skip.png
94 yellow 11 ./cards/Yellow_Reverse.png
95 yellow 12 ./cards/Yellow_Draw.png
96 yellow 1 ./cards/Yellow_1.png
97 yellow 2 ./cards/Yellow_2.png
98 yellow 3 ./cards/Yellow_3.png
99 yellow 4 ./cards/Yellow_4.png
100 yellow 5 ./cards/Yellow_5.png
101 yellow 6 ./cards/Yellow_6.png
102 yellow 7 ./cards/Yellow_7.png
103 yellow 8 ./cards/Yellow_8.png
104 yellow 9 ./cards/Yellow_9.png
105 yellow 10 ./cards/Yellow_Skip.png
106 yellow 11 ./cards/Yellow_Reverse.png
107 yellow 12 ./cards/Yellow_Draw.png
\.
--
-- Data for Name: uno_effects; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.uno_effects (effectid, uno_values, effect) FROM stdin;
0 0 number
1 1 number
2 2 number
3 3 number
4 4 number
5 5 number
6 6 number
7 7 number
8 8 number
9 9 number
10 10 skip
11 11 reverse
12 12 draw
13 13 wild
14 14 wilddraw
\.
--
-- Data for Name: uno_leaderboard; Type: TABLE DATA; Schema: public; Owner: postgres
--
-- Participation (lose) - 10
-- Participation (win) - 20
-- min 35, max <150
-- normal: 5
-- wildcard: 10
--
INSERT INTO
uno_leaderboard (userid, score, game_status, created_at)
VALUES
(15, 10, 0, '2022-01-14 21:22:29'),
(15, 10, 0, '2022-01-15 21:22:29'),
(15, 10, 0, '2022-01-20 21:22:29'),
(17, 140, 1, '2022-01-15 21:22:29'),
(17, 120, 1, '2022-01-15 21:22:29'),
(17, 75, 1, '2022-01-21 21:22:29'),
(26, 135, 1, '2022-01-15 21:22:29'),
(26, 100, 1, '2022-01-16 21:22:29'),
(26, 90, 1, '2022-01-24 21:22:29'),
(27, 10, 0, '2022-01-13 21:22:29'),
(27, 10, 0, '2022-01-15 21:22:29'),
(27, 10, 0, '2022-01-15 21:22:29'),
(27, 145, 1, '2022-01-15 21:22:29'),
(27, 55, 0, '2022-01-18 21:22:29'),
(27, 21, 3, '2022-01-18 21:22:29'),
(27, 10, 0, '2022-01-19 21:22:29'),
(28, 10, 0, '2022-01-14 21:22:29'),
(28, 10, 0, '2022-01-15 21:22:29'),
(28, 10, 0, '2022-01-17 21:22:29'),
(29, 10, 0, '2022-01-12 21:22:29'),
(29, 10, 0, '2022-01-14 21:22:29'),
(29, 10, 0, '2022-01-22 21:22:29'),
(30, 125, 1, '2022-01-14 21:22:29'),
(30, 50, 1, '2022-01-15 21:22:29'),
(30, 85, 1, '2022-01-15 21:22:29'),
(31, 10, 0, '2022-01-14 21:22:29'),
(31, 10, 0, '2022-01-14 21:22:29'),
(31, 10, 0, '2022-01-21 21:22:29'),
(33, 10, 0, '2022-01-13 21:22:29'),
(33, 10, 0, '2022-01-14 21:22:29'),
(33, 10, 0, '2022-01-20 21:22:29');
--
-- Name: players_userid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.players_userid_seq', 33, true);
--
-- Name: uno_cards_card_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.uno_cards_card_id_seq', 2, true);
--
-- Name: uno_effects_effectid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.uno_effects_effectid_seq', 1, false);
--
-- Name: uno_leaderboard_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.uno_leaderboard_id_seq', 20, true);
--
-- Name: players players_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.players
ADD CONSTRAINT players_pkey PRIMARY KEY (userid);
--
-- Name: uno_cards uno_cards_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.uno_cards
ADD CONSTRAINT uno_cards_pkey PRIMARY KEY (card_id);
--
-- Name: uno_effects uno_effects_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.uno_effects
ADD CONSTRAINT uno_effects_pkey PRIMARY KEY (effectid);
--
-- Name: uno_leaderboard uno_leaderboard_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.uno_leaderboard
ADD CONSTRAINT uno_leaderboard_pkey PRIMARY KEY (id);
--
-- Name: uno_leaderboard fk_userid; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.uno_leaderboard
ADD CONSTRAINT fk_userid FOREIGN KEY (userid) REFERENCES public.players(userid) ON DELETE CASCADE;
--
-- PostgreSQL database dump complete
--
-- Create Friendship Table
CREATE TABLE friends (
id SERIAL PRIMARY KEY NOT NULL,
userId INTEGER NOT NULL,
fk_friendId INTEGER NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (userId) REFERENCES players(userid) ON DELETE CASCADE,
FOREIGN KEY (fk_friendId) REFERENCES players(userid) ON DELETE CASCADE
);
INSERT INTO
friends
(userId, fk_friendId)
VALUES
(27, 17),
(17, 27),
(15, 27),
(27, 15),
(15, 17),
(17, 15),
(15, 28),
(28, 15),
(27, 28);
INSERT INTO
friends
(userid, fk_friendid)
VALUES
(17, 27),
(27, 17),
(17, 15),
(15, 17),
(15, 28),
(28, 15),
(27, 15),
(15, 27),
(27, 28),
(28, 27),
(27, 29),
(29, 27);