-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyFlixDatabase.json
463 lines (328 loc) · 15.1 KB
/
myFlixDatabase.json
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
--
-- PostgreSQL database dump
--
-- Dumped from database version 15.2
-- Dumped by pg_dump version 15.2
-- Started on 2023-05-12 18:41:44 BST
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;
--
-- TOC entry 217 (class 1259 OID 16409)
-- Name: directors; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.directors (
directorid integer NOT NULL,
name character varying(50) NOT NULL,
bio character varying(1000),
birthyear date,
deathyear date
);
ALTER TABLE public.directors OWNER TO postgres;
--
-- TOC entry 216 (class 1259 OID 16408)
-- Name: directors_directorid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.directors_directorid_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.directors_directorid_seq OWNER TO postgres;
--
-- TOC entry 3635 (class 0 OID 0)
-- Dependencies: 216
-- Name: directors_directorid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.directors_directorid_seq OWNED BY public.directors.directorid;
--
-- TOC entry 215 (class 1259 OID 16400)
-- Name: genres; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.genres (
genreid integer NOT NULL,
name character varying(50) NOT NULL,
description character varying(1000)
);
ALTER TABLE public.genres OWNER TO postgres;
--
-- TOC entry 214 (class 1259 OID 16399)
-- Name: genres_genreid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.genres_genreid_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.genres_genreid_seq OWNER TO postgres;
--
-- TOC entry 3636 (class 0 OID 0)
-- Dependencies: 214
-- Name: genres_genreid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.genres_genreid_seq OWNED BY public.genres.genreid;
--
-- TOC entry 219 (class 1259 OID 16472)
-- Name: movies; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.movies (
movieid integer NOT NULL,
title character varying(50) NOT NULL,
description character varying(1000),
directorid integer NOT NULL,
genreid integer NOT NULL,
imageurl character varying(300),
featured boolean
);
ALTER TABLE public.movies OWNER TO postgres;
--
-- TOC entry 218 (class 1259 OID 16471)
-- Name: movies_movieid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.movies_movieid_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.movies_movieid_seq OWNER TO postgres;
--
-- TOC entry 3637 (class 0 OID 0)
-- Dependencies: 218
-- Name: movies_movieid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.movies_movieid_seq OWNED BY public.movies.movieid;
--
-- TOC entry 223 (class 1259 OID 16498)
-- Name: user_movies; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.user_movies (
usermovieid integer NOT NULL,
userid integer,
movieid integer
);
ALTER TABLE public.user_movies OWNER TO postgres;
--
-- TOC entry 222 (class 1259 OID 16497)
-- Name: user_movies_usermovieid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.user_movies_usermovieid_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.user_movies_usermovieid_seq OWNER TO postgres;
--
-- TOC entry 3638 (class 0 OID 0)
-- Dependencies: 222
-- Name: user_movies_usermovieid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.user_movies_usermovieid_seq OWNED BY public.user_movies.usermovieid;
--
-- TOC entry 221 (class 1259 OID 16491)
-- Name: users; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.users (
userid integer NOT NULL,
username character varying(50) NOT NULL,
password character varying(50) NOT NULL,
email character varying(50) NOT NULL,
birth_date date
);
ALTER TABLE public.users OWNER TO postgres;
--
-- TOC entry 220 (class 1259 OID 16490)
-- Name: users_userid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.users_userid_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.users_userid_seq OWNER TO postgres;
--
-- TOC entry 3639 (class 0 OID 0)
-- Dependencies: 220
-- Name: users_userid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.users_userid_seq OWNED BY public.users.userid;
--
-- TOC entry 3460 (class 2604 OID 16412)
-- Name: directors directorid; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.directors ALTER COLUMN directorid SET DEFAULT nextval('public.directors_directorid_seq'::regclass);
--
-- TOC entry 3459 (class 2604 OID 16403)
-- Name: genres genreid; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.genres ALTER COLUMN genreid SET DEFAULT nextval('public.genres_genreid_seq'::regclass);
--
-- TOC entry 3461 (class 2604 OID 16475)
-- Name: movies movieid; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.movies ALTER COLUMN movieid SET DEFAULT nextval('public.movies_movieid_seq'::regclass);
--
-- TOC entry 3463 (class 2604 OID 16501)
-- Name: user_movies usermovieid; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.user_movies ALTER COLUMN usermovieid SET DEFAULT nextval('public.user_movies_usermovieid_seq'::regclass);
--
-- TOC entry 3462 (class 2604 OID 16494)
-- Name: users userid; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.users ALTER COLUMN userid SET DEFAULT nextval('public.users_userid_seq'::regclass);
--
-- TOC entry 3623 (class 0 OID 16409)
-- Dependencies: 217
-- Data for Name: directors; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.directors (directorid, name, bio, birthyear, deathyear) VALUES (1, 'Jonathan Demme', 'Robert Jonathan Demme was an American director, producer, and screenwriter.', '1944-01-01', '2017-01-01');
INSERT INTO public.directors (directorid, name, bio, birthyear, deathyear) VALUES (2, 'Judd Apatow', 'Judd Apatow is an American producer, writer, director, actor and stand-up comedian.', '1967-01-01', NULL);
INSERT INTO public.directors (directorid, name, bio, birthyear, deathyear) VALUES (3, 'Christopher Nolan', 'Christopher Nolan is a British-American filmmaker known for his complex and nonlinear storytelling.', '1970-07-30', NULL);
INSERT INTO public.directors (directorid, name, bio, birthyear, deathyear) VALUES (4, 'Taika Waititi', 'Taika Waititi is a New Zealand filmmaker, actor, and comedian.', '1975-08-16', NULL);
INSERT INTO public.directors (directorid, name, bio, birthyear, deathyear) VALUES (5, 'Jordan Peele', 'Jordan Peele is an American actor, comedian, and filmmaker known for his horror and social commentary.', '1979-02-21', NULL);
--
-- TOC entry 3621 (class 0 OID 16400)
-- Dependencies: 215
-- Data for Name: genres; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.genres (genreid, name, description) VALUES (1, 'Animated', 'Animation is a method in which pictures are manipulated to appear as moving images. In traditional animation, images are drawn or painted by hand on transparent celluloid sheets to be photographed and exhibited on film.');
INSERT INTO public.genres (genreid, name, description) VALUES (2, 'Comedy', 'Comedy is a genre of film in which the main emphasis is on humor. These films are designed to make the audience laugh through amusement and most often work by exaggerating characteristics for humorous effect.');
INSERT INTO public.genres (genreid, name, description) VALUES (3, 'Thriller', 'Thriller film, also known as suspense film or suspense thriller, is a broad film genre that involves excitement and suspense in the audience.');
--
-- TOC entry 3625 (class 0 OID 16472)
-- Dependencies: 219
-- Data for Name: movies; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.movies (movieid, title, description, directorid, genreid, imageurl, featured) VALUES (1, 'Silence of the Lambs', 'A young FBI cadet must receive the help of an incarcerated and manipulative cannibal killer to help catch another serial killer.', 1, 1, 'silenceofthelambs.png', true);
INSERT INTO public.movies (movieid, title, description, directorid, genreid, imageurl, featured) VALUES (39, 'Inception', 'A skilled thief enters people''s dreams and steals their secrets from their subconscious.', 1, 1, 'inception.png', true);
INSERT INTO public.movies (movieid, title, description, directorid, genreid, imageurl, featured) VALUES (41, 'The Prestige', 'Two magicians engage in a fierce competition to create the ultimate stage illusion.', 1, 2, 'prestige.png', false);
INSERT INTO public.movies (movieid, title, description, directorid, genreid, imageurl, featured) VALUES (42, 'Thor: Ragnarok', 'Thor is imprisoned on the planet Sakaar and must race against time to prevent the goddess of death from destroying Asgard.', 2, 1, 'thorragnarok.png', false);
INSERT INTO public.movies (movieid, title, description, directorid, genreid, imageurl, featured) VALUES (43, 'Hunt for the Wilderpeople', 'A national manhunt is ordered for a rebellious kid and his foster uncle who go missing in the wild New Zealand bush.', 2, 3, 'wilderpeople.png', false);
INSERT INTO public.movies (movieid, title, description, directorid, genreid, imageurl, featured) VALUES (44, 'Get Out', 'A young black man visits his white girlfriend''s family for the weekend and uncovers a series of disturbing secrets.', 3, 2, 'getout.png', false);
INSERT INTO public.movies (movieid, title, description, directorid, genreid, imageurl, featured) VALUES (45, 'Us', 'A family''s vacation turns into a nightmare when they are confronted by their doppelgangers.', 3, 2, 'us.png', false);
INSERT INTO public.movies (movieid, title, description, directorid, genreid, imageurl, featured) VALUES (46, 'Jojo Rabbit', 'A young boy in Hitler''s army finds out his mother is hiding a Jewish girl in their home.', 2, 2, 'jojorabbit.png', false);
INSERT INTO public.movies (movieid, title, description, directorid, genreid, imageurl, featured) VALUES (47, 'Black Panther', 'T''Challa, the king of Wakanda, rises to the throne in the isolated,technologically advanced African nation, but his claim is challenged by a vengeful outsider.', 2, 1, 'blackpanther.png', false);
INSERT INTO public.movies (movieid, title, description, directorid, genreid, imageurl, featured) VALUES (48, 'La La Land', 'Two young artists fall in love in Los Angeles while pursuing their dreams.', 2, 2, 'lalaland.png', false);
--
-- TOC entry 3629 (class 0 OID 16498)
-- Dependencies: 223
-- Data for Name: user_movies; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.user_movies (usermovieid, userid, movieid) VALUES (17, 1, 1);
INSERT INTO public.user_movies (usermovieid, userid, movieid) VALUES (18, 1, 1);
INSERT INTO public.user_movies (usermovieid, userid, movieid) VALUES (19, 3, 1);
--
-- TOC entry 3627 (class 0 OID 16491)
-- Dependencies: 221
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.users (userid, username, password, email, birth_date) VALUES (1, 'johnsmith', 'password123', 'johnsmith@email.com', NULL);
INSERT INTO public.users (userid, username, password, email, birth_date) VALUES (3, 'bobross', 'happytrees456', 'bobross@email.com', NULL);
INSERT INTO public.users (userid, username, password, email, birth_date) VALUES (2, 'janedoe', 'letmein321', 'newemail@janedoe.com', NULL);
--
-- TOC entry 3640 (class 0 OID 0)
-- Dependencies: 216
-- Name: directors_directorid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.directors_directorid_seq', 5, true);
--
-- TOC entry 3641 (class 0 OID 0)
-- Dependencies: 214
-- Name: genres_genreid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.genres_genreid_seq', 3, true);
--
-- TOC entry 3642 (class 0 OID 0)
-- Dependencies: 218
-- Name: movies_movieid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.movies_movieid_seq', 48, true);
--
-- TOC entry 3643 (class 0 OID 0)
-- Dependencies: 222
-- Name: user_movies_usermovieid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.user_movies_usermovieid_seq', 19, true);
--
-- TOC entry 3644 (class 0 OID 0)
-- Dependencies: 220
-- Name: users_userid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.users_userid_seq', 3, true);
--
-- TOC entry 3467 (class 2606 OID 16416)
-- Name: directors directors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.directors
ADD CONSTRAINT directors_pkey PRIMARY KEY (directorid);
--
-- TOC entry 3465 (class 2606 OID 16407)
-- Name: genres genres_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.genres
ADD CONSTRAINT genres_pkey PRIMARY KEY (genreid);
--
-- TOC entry 3469 (class 2606 OID 16479)
-- Name: movies movies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.movies
ADD CONSTRAINT movies_pkey PRIMARY KEY (movieid);
--
-- TOC entry 3473 (class 2606 OID 16503)
-- Name: user_movies user_movies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.user_movies
ADD CONSTRAINT user_movies_pkey PRIMARY KEY (usermovieid);
--
-- TOC entry 3471 (class 2606 OID 16496)
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pkey PRIMARY KEY (userid);
--
-- TOC entry 3474 (class 2606 OID 16485)
-- Name: movies directorkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.movies
ADD CONSTRAINT directorkey FOREIGN KEY (directorid) REFERENCES public.directors(directorid);
--
-- TOC entry 3475 (class 2606 OID 16480)
-- Name: movies genrekey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.movies
ADD CONSTRAINT genrekey FOREIGN KEY (genreid) REFERENCES public.genres(genreid);
--
-- TOC entry 3476 (class 2606 OID 16509)
-- Name: user_movies moviekey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.user_movies
ADD CONSTRAINT moviekey FOREIGN KEY (movieid) REFERENCES public.movies(movieid);
--
-- TOC entry 3477 (class 2606 OID 16504)
-- Name: user_movies userkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.user_movies
ADD CONSTRAINT userkey FOREIGN KEY (userid) REFERENCES public.users(userid);
-- Completed on 2023-05-12 18:41:44 BST
--
-- PostgreSQL database dump complete
--