-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStreamDB.sql
More file actions
712 lines (572 loc) · 23.9 KB
/
StreamDB.sql
File metadata and controls
712 lines (572 loc) · 23.9 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
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
--
-- PostgreSQL database dump
--
-- Dumped from database version 15.8
-- Dumped by pg_dump version 16.4
-- Started on 2026-02-28 15:47:46
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 218 (class 1259 OID 16752)
-- Name: Comment; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Comment" (
comment_id integer NOT NULL,
profile_id integer NOT NULL,
content_id integer NOT NULL,
comment_text character varying(500) NOT NULL,
comment_date date NOT NULL
);
ALTER TABLE public."Comment" OWNER TO postgres;
--
-- TOC entry 216 (class 1259 OID 16732)
-- Name: Content; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Content" (
content_id integer NOT NULL,
title character varying(100) NOT NULL,
release_year integer NOT NULL,
content_type character varying(20) NOT NULL,
genre character varying(150) NOT NULL,
language character varying(30) NOT NULL,
description character varying(300),
duration interval(6)
);
ALTER TABLE public."Content" OWNER TO postgres;
--
-- TOC entry 222 (class 1259 OID 16821)
-- Name: Episodes; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Episodes" (
episode_id integer NOT NULL,
season_id integer NOT NULL,
content_id integer NOT NULL,
title character varying,
duration interval
);
ALTER TABLE public."Episodes" OWNER TO postgres;
--
-- TOC entry 215 (class 1259 OID 16722)
-- Name: Profiles; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Profiles" (
profile_id integer NOT NULL,
user_id integer NOT NULL,
profile_name character varying(75) NOT NULL,
age integer,
language character varying(30)
);
ALTER TABLE public."Profiles" OWNER TO postgres;
--
-- TOC entry 217 (class 1259 OID 16737)
-- Name: Ratings; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Ratings" (
rating_id integer NOT NULL,
profile_id integer NOT NULL,
content_id integer NOT NULL,
rating_value integer,
rating_date date
);
ALTER TABLE public."Ratings" OWNER TO postgres;
--
-- TOC entry 221 (class 1259 OID 16811)
-- Name: Seasons; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Seasons" (
season_id integer NOT NULL,
content_id integer NOT NULL,
season_number integer NOT NULL
);
ALTER TABLE public."Seasons" OWNER TO postgres;
--
-- TOC entry 220 (class 1259 OID 16784)
-- Name: Trailers; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Trailers" (
trailer_id integer NOT NULL,
content_id integer NOT NULL,
title character varying(150) NOT NULL,
trailer_url character varying(300) NOT NULL,
language character varying(30) NOT NULL
);
ALTER TABLE public."Trailers" OWNER TO postgres;
--
-- TOC entry 214 (class 1259 OID 16713)
-- Name: Users; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Users" (
user_id integer NOT NULL,
"fullName" character varying(150) NOT NULL,
username character varying(100) NOT NULL,
"e-mail" character varying(100) NOT NULL,
password integer NOT NULL,
phone_number bigint,
"sub_Type" character varying(25)
);
ALTER TABLE public."Users" OWNER TO postgres;
--
-- TOC entry 219 (class 1259 OID 16769)
-- Name: WatchHistory; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."WatchHistory" (
history_id integer NOT NULL,
profile_id integer NOT NULL,
content_id integer NOT NULL,
watched_date date NOT NULL
);
ALTER TABLE public."WatchHistory" OWNER TO postgres;
--
-- TOC entry 3385 (class 0 OID 16752)
-- Dependencies: 218
-- Data for Name: Comment; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Comment" (comment_id, profile_id, content_id, comment_text, comment_date) FROM stdin;
10001 1 101 Breaking Bad is an incredible show! 2024-01-01
10002 2 102 The Godfather is a timeless classic. 2024-01-02
10003 3 103 Stranger Things has such an amazing story. 2024-01-03
10004 4 104 Parasite is a masterpiece of cinema. 2024-01-04
10005 5 105 Friends is my all-time favorite comedy. 2024-01-05
10006 6 106 Interstellar is mind-blowing! 2024-01-06
10007 7 107 Money Heist keeps you on the edge of your seat. 2024-01-07
10008 8 108 Inception is brilliant and thought-provoking. 2024-01-08
10009 9 109 The Crown portrays history beautifully. 2024-01-09
10010 10 110 Coco is heartwarming and visually stunning. 2024-01-10
10011 11 111 Avatar is a visual spectacle. 2024-01-11
10012 12 112 The Office is hilariously relatable. 2024-01-12
10013 13 113 Game of Thrones had an epic storyline. 2024-01-13
10014 14 114 Breaking Dawn has a beautiful love story. 2024-01-14
10015 15 115 Black Mirror makes you question technology. 2024-01-15
10016 16 116 The Matrix is groundbreaking. 2024-01-16
10017 17 117 Shrek is a wonderful mix of humor and heart. 2024-01-17
10018 18 118 The Simpsons never gets old. 2024-01-18
10019 19 119 Toy Story is a childhood treasure. 2024-01-19
10020 20 120 The Witcher is an epic fantasy. 2024-01-20
10021 21 121 Django Unchained is Quentin Tarantino at his best. 2024-01-21
10022 22 122 Narcos is an intense and gripping series. 2024-01-22
10023 23 123 Frozen is magical and inspiring. 2024-01-23
10024 1 124 The Mandalorian expands the Star Wars universe beautifully. 2024-01-24
10025 2 125 The Lion King is a timeless masterpiece. 2024-01-25
10026 13 116 The matrix is the movie i have ever seen 2024-03-24
10027 17 116 The matrix is unbeliavable 2024-07-26
\.
--
-- TOC entry 3383 (class 0 OID 16732)
-- Dependencies: 216
-- Data for Name: Content; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Content" (content_id, title, release_year, content_type, genre, language, description, duration) FROM stdin;
101 Breaking Bad 2008 Series Drama, Crime English A high school chemistry teacher turned methamphetamine producer. 00:49:00
102 The Godfather 1972 Movie Crime, Drama English The aging patriarch of an organized crime dynasty transfers control to his reluctant son. 02:55:00
103 Stranger Things 2016 Series Sci-Fi, Thriller English A group of kids uncover mysteries involving supernatural forces. 00:50:00
104 Parasite 2019 Movie Drama, Thriller Korean A poor family schemes to become employed by a wealthy household. 02:12:00
105 Friends 1994 Series Comedy, Romance English Follows the personal and professional lives of six twenty to thirty-something-year-old friends. 00:22:00
106 Interstellar 2014 Movie Sci-Fi, Drama English A team of explorers travel through a wormhole in space to ensure humanity's survival. 02:49:00
107 Money Heist 2017 Series Crime, Drama, Thriller Spanish A criminal mastermind plans a heist on the Royal Mint of Spain. 00:45:00
108 Inception 2010 Movie Sci-Fi, Thriller English A thief who steals corporate secrets through dream-sharing technology is given a task. 02:28:00
109 The Crown 2016 Series Drama, Biography English Follows the reign of Queen Elizabeth II. 00:58:00
110 Coco 2017 Movie Animation, Adventure Spanish A boy journeys to the Land of the Dead to seek forgiveness from his ancestors. 01:45:00
111 Avatar 2009 Movie Action, Sci-Fi English A paraplegic Marine is sent to Pandora on a unique mission. 02:42:00
112 The Office 2005 Series Comedy English A mockumentary on a group of typical office workers. 00:22:00
113 Game of Thrones 2011 Series Drama, Fantasy English Nine noble families fight for control over the lands of Westeros. 01:00:00
114 Breaking Dawn 2011 Movie Romance, Fantasy English The Quileutes close in on expecting parents Edward and Bella. 01:55:00
115 Black Mirror 2011 Series Drama, Sci-Fi English An anthology series exploring a twisted high-tech multiverse. 00:50:00
116 The Matrix 1999 Movie Action, Sci-Fi English A hacker learns the truth about his world and fights for freedom. 02:16:00
117 Shrek 2001 Movie Animation, Comedy English An ogre falls in love with a princess while on a quest. 01:30:00
118 The Simpsons 1989 Series Animation, Comedy English A satirical depiction of a middle-class family. 00:22:00
119 Toy Story 1995 Movie Animation, Adventure English A cowboy doll is profoundly threatened by the arrival of a spaceman toy. 01:21:00
120 The Witcher 2019 Series Action, Fantasy English Geralt of Rivia, a monster hunter, struggles to find his place. 01:00:00
121 Django Unchained 2012 Movie Drama, Western English A freed slave sets out to rescue his wife from a brutal plantation owner. 02:45:00
122 Narcos 2015 Series Crime, Drama Spanish A chronicled look at the criminal exploits of Colombian drug lord Pablo Escobar. 00:49:00
123 Frozen 2013 Movie Animation, Adventure English A princess sets out to find her sister whose powers have trapped their kingdom in winter. 01:42:00
124 The Mandalorian 2019 Series Action, Sci-Fi English The travels of a lone bounty hunter in the outer reaches of the galaxy. 00:35:00
125 The Lion King 1994 Movie Animation, Adventure English Lion prince Simba learns the true meaning of responsibility and bravery. 01:28:00
\.
--
-- TOC entry 3389 (class 0 OID 16821)
-- Dependencies: 222
-- Data for Name: Episodes; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Episodes" (episode_id, season_id, content_id, title, duration) FROM stdin;
1001 201 101 Pilot 00:58:00
1002 201 101 Cat's in the Bag 00:47:00
1003 201 101 ...And the Bag's in the River 00:48:00
1004 202 103 The Vanishing of Will Byers 00:55:00
1005 202 103 The Weirdo on Maple Street 00:57:00
1006 202 103 Holly, Jolly 00:59:00
1007 203 103 Madmax 00:52:00
1008 203 103 Trick or Treat, Freak 00:54:00
1009 204 107 Efectuar lo Acordado 00:45:00
1010 204 107 Imprudencias Letales 00:44:00
1011 205 107 La Cabeza del Plan 00:46:00
1012 206 109 Wolferton Splash 01:00:00
1013 206 109 Hyde Park Corner 00:58:00
1014 207 112 Pilot 00:22:00
1015 207 112 Diversity Day 00:22:00
1016 207 112 Health Care 00:22:00
1017 208 113 Winter is Coming 01:02:00
1018 208 113 The Kingsroad 00:56:00
1019 209 113 Lord Snow 00:58:00
1020 210 113 Cripples, Bastards, and Broken Things 00:59:00
1021 211 115 The National Anthem 00:44:00
1022 211 115 Fifteen Million Merits 01:02:00
1023 212 120 The End's Beginning 01:01:00
1024 212 120 Four Marks 01:00:00
1025 213 122 Descenso 00:49:00
1026 213 122 The Sword of Simón Bolívar 00:47:00
1027 214 124 Chapter 1: The Mandalorian 00:39:00
1028 214 124 Chapter 2: The Child 00:32:00
\.
--
-- TOC entry 3382 (class 0 OID 16722)
-- Dependencies: 215
-- Data for Name: Profiles; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Profiles" (profile_id, user_id, profile_name, age, language) FROM stdin;
1 1001 Larry's Main Profile 35 English
2 1001 Kids Profile 8 English
3 1002 Stephanie's Profile 28 French
4 1002 Family Profile \N English
5 1003 Douglas's Profile 42 Spanish
6 1004 Jason's Main Profile 31 German
7 1005 Adam's Profile 25 English
8 1005 Travel Profile 25 Spanish
9 1006 Brian's Profile 40 French
10 1007 Sandra's Profile 22 English
11 1008 Patricia's Profile 27 Italian
12 1009 Lisa's Profile 19 English
13 1010 Thomas's Profile 45 German
14 1011 Donna's Profile 36 English
15 1012 Joseph's Profile 29 Spanish
16 1013 David's Profile 33 English
17 1014 Susan's Profile 41 French
18 1015 Michael's Profile 26 English
19 1016 Angela's Profile 30 Spanish
20 1017 Mark's Profile 50 German
21 1018 Sarah's Profile 23 English
22 1019 Deborah's Profile 37 French
23 1020 James's Profile 34 Italian
\.
--
-- TOC entry 3384 (class 0 OID 16737)
-- Dependencies: 217
-- Data for Name: Ratings; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Ratings" (rating_id, profile_id, content_id, rating_value, rating_date) FROM stdin;
1 1 101 5 2024-06-01
2 2 102 4 2024-05-02
3 3 103 5 2024-04-03
4 4 104 5 2024-02-04
5 5 105 4 2024-01-05
6 6 106 5 2024-05-06
7 7 107 4 2024-03-07
8 8 108 5 2024-07-08
9 9 109 4 2024-01-09
10 10 110 5 2024-12-10
11 11 111 5 2024-11-11
12 12 112 4 2024-09-12
13 13 113 5 2024-07-13
14 14 114 3 2024-06-14
15 15 115 4 2024-04-15
16 16 116 5 2024-08-16
17 17 117 5 2024-12-17
18 18 118 4 2024-03-18
19 19 119 5 2024-11-19
20 20 120 4 2024-06-20
21 21 121 5 2024-01-21
22 22 122 4 2024-03-22
23 23 123 5 2024-02-23
24 1 124 4 2024-07-24
25 2 125 5 2024-05-25
\.
--
-- TOC entry 3388 (class 0 OID 16811)
-- Dependencies: 221
-- Data for Name: Seasons; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Seasons" (season_id, content_id, season_number) FROM stdin;
201 101 1
202 103 1
203 103 2
204 107 1
205 107 2
206 109 1
207 112 1
208 113 1
209 113 2
210 113 3
211 115 1
212 120 1
213 122 1
214 124 1
215 101 2
216 101 3
217 101 4
218 101 5
219 103 3
220 103 4
221 103 5
222 107 3
223 107 4
224 112 2
225 112 3
226 112 4
227 112 5
228 112 6
229 112 7
230 112 8
231 112 9
232 113 4
233 113 5
234 113 6
235 113 7
236 113 8
237 120 2
238 120 3
239 120 4
240 122 2
241 122 3
\.
--
-- TOC entry 3387 (class 0 OID 16784)
-- Dependencies: 220
-- Data for Name: Trailers; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Trailers" (trailer_id, content_id, title, trailer_url, language) FROM stdin;
10 101 Breaking Bad Official Trailer https://www.youtube.com/watch?v=HhesaQXLuRY English
11 102 The Godfather Trailer https://www.youtube.com/watch?v=UaVTIH8mujA English
12 103 Stranger Things Season 1 Trailer https://www.youtube.com/watch?v=Y1-dIVhEPPs English
13 104 Parasite Official Trailer https://www.youtube.com/watch?v=SEUXfv87Wpk Korean
14 105 Friends Intro https://www.youtube.com/watch?v=s2TyVQGoCYo English
15 106 Interstellar Trailer https://www.youtube.com/watch?v=zSWdZVtXT7E English
16 107 Money Heist Part 1 Trailer https://www.youtube.com/watch?v=_InqQJRqGW4 Spanish
17 108 Inception Official Trailer https://www.youtube.com/watch?v=YoHD9XEInc0 English
18 109 The Crown Season 1 Trailer https://www.youtube.com/watch?v=JWtnJjn6ng0 English
19 110 Coco Trailer https://www.youtube.com/watch?v=xlnPHQ3TLX8 Spanish
20 111 Avatar Official Trailer https://www.youtube.com/watch?v=5PSNL1qE6VY English
21 112 The Office Trailer https://www.youtube.com/watch?v=tNcDHWpselE English
22 113 Game of Thrones Season 1 Trailer https://www.youtube.com/watch?v=bjqEWgDVPe0 English
23 114 Breaking Dawn Part 1 Trailer https://www.youtube.com/watch?v=PQNLfo-SOR4 English
24 115 Black Mirror Season 1 Trailer https://www.youtube.com/watch?v=di6emt8_ie8 English
25 116 The Matrix Trailer https://www.youtube.com/watch?v=vKQi3bBA1y8 English
26 117 Shrek Official Trailer https://www.youtube.com/watch?v=CwXOrWvPBPk English
27 118 The Simpsons Intro https://www.youtube.com/watch?v=jfVBrpIhH60 English
28 119 Toy Story Trailer https://www.youtube.com/watch?v=v-PjgYDrg70 English
29 120 The Witcher Season 1 Trailer https://www.youtube.com/watch?v=cSqi-8kAMmM English
30 121 Django Unchained Trailer https://www.youtube.com/watch?v=0fUCuvNlOCg English
31 122 Narcos Season 1 Trailer https://www.youtube.com/watch?v=xl8zdCY-abw Spanish
32 123 Frozen Official Trailer https://www.youtube.com/watch?v=TbQm5doF_Uc English
33 124 The Mandalorian Season 1 Trailer https://www.youtube.com/watch?v=aOC8E8z_ifw English
34 125 The Lion King Trailer https://www.youtube.com/watch?v=o17MF9vnabg English
\.
--
-- TOC entry 3381 (class 0 OID 16713)
-- Dependencies: 214
-- Data for Name: Users; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Users" (user_id, "fullName", username, "e-mail", password, phone_number, "sub_Type") FROM stdin;
1001 Larry Perez larryperez larryperez@example.com 29444748 9845087750 Standard
1002 Stephanie Jones stephaniejones stephaniejones@example.com 42265103 6265242007 Premium
1003 Douglas Solis douglassolis douglassolis@example.com 32034853 4608540092 Basic
1004 Jason Nichols jasonnichols jasonnichols@example.com 46249089 3735987405 Premium
1005 Adam May adammay adammay@example.com 95269543 8145034680 Standard
1006 Brian Collins briancollins briancollins@example.com 67520129 1114005844 Premium
1007 Sandra Ellis sandraellis sandraellis@example.com 31209847 4266885745 Basic
1008 Patricia Lee patricialee patricialee@example.com 87123409 3432999481 Premium
1009 Lisa Miller lisamiller lisamiller@example.com 70182954 1929453159 Standard
1010 Thomas Scott thomasscott thomasscott@example.com 57438264 3578976329 Premium
1011 Donna Mitchell donnamitchell donnamitchell@example.com 31589210 9828301642 Standard
1012 Joseph Clark josephclark josephclark@example.com 61234780 2194709755 Basic
1013 David Moore davidmoore davidmoore@example.com 45182390 6878361217 Premium
1014 Susan Evans susanevans susanevans@example.com 73284901 3478562397 Standard
1015 Michael Baker michaelbaker michaelbaker@example.com 85471032 3709841487 Basic
1016 Angela Gonzalez angelagonzalez angelagonzalez@example.com 45389017 6065120892 Premium
1017 Mark Martinez markmartinez markmartinez@example.com 79562314 1386847312 Standard
1018 Sarah White sarahwhite sarahwhite@example.com 61473829 6753248312 Premium
1019 Deborah Thompson deborahthompson deborahthompson@example.com 90234715 8879535643 Basic
1020 James Turner jamesturner jamesturner@example.com 62190432 2519485729 Premium
\.
--
-- TOC entry 3386 (class 0 OID 16769)
-- Dependencies: 219
-- Data for Name: WatchHistory; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."WatchHistory" (history_id, profile_id, content_id, watched_date) FROM stdin;
1 1 101 2024-01-11
2 2 102 2024-03-24
3 3 103 2024-04-03
4 4 104 2024-07-29
5 5 105 2024-11-24
6 6 106 2024-04-06
7 7 107 2024-08-17
8 8 108 2024-09-11
9 9 109 2024-10-29
10 10 110 2024-12-11
11 11 111 2024-05-14
12 12 112 2024-07-18
13 13 113 2024-09-16
14 14 114 2024-03-15
15 15 115 2024-04-12
16 16 116 2024-08-30
17 17 117 2024-06-29
18 18 118 2024-12-27
19 19 119 2024-10-23
20 20 120 2024-01-26
21 21 121 2024-02-10
22 22 122 2024-07-03
23 23 123 2024-03-07
24 1 124 2024-06-11
25 2 125 2024-09-13
\.
--
-- TOC entry 3217 (class 2606 OID 16758)
-- Name: Comment comments_comment_id_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Comment"
ADD CONSTRAINT comments_comment_id_pkey PRIMARY KEY (comment_id);
--
-- TOC entry 3213 (class 2606 OID 16736)
-- Name: Content content_content_id_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Content"
ADD CONSTRAINT content_content_id_pkey PRIMARY KEY (content_id);
--
-- TOC entry 3227 (class 2606 OID 16827)
-- Name: Episodes episodes_episode_id_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Episodes"
ADD CONSTRAINT episodes_episode_id_pkey PRIMARY KEY (episode_id);
--
-- TOC entry 3211 (class 2606 OID 16726)
-- Name: Profiles profiles_profile_id_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Profiles"
ADD CONSTRAINT profiles_profile_id_pkey PRIMARY KEY (profile_id);
--
-- TOC entry 3215 (class 2606 OID 16741)
-- Name: Ratings ratings_rating_id_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Ratings"
ADD CONSTRAINT ratings_rating_id_pkey PRIMARY KEY (rating_id);
--
-- TOC entry 3225 (class 2606 OID 16815)
-- Name: Seasons seasons_season_id_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Seasons"
ADD CONSTRAINT seasons_season_id_pkey PRIMARY KEY (season_id);
--
-- TOC entry 3221 (class 2606 OID 16788)
-- Name: Trailers trailers_trailer_id_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Trailers"
ADD CONSTRAINT trailers_trailer_id_pkey PRIMARY KEY (trailer_id);
--
-- TOC entry 3205 (class 2606 OID 16719)
-- Name: Users unique_e-mail; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Users"
ADD CONSTRAINT "unique_e-mail" UNIQUE ("e-mail");
--
-- TOC entry 3207 (class 2606 OID 16721)
-- Name: Users unique_phone_number; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Users"
ADD CONSTRAINT unique_phone_number UNIQUE (phone_number);
--
-- TOC entry 3223 (class 2606 OID 16790)
-- Name: Trailers unique_trailer_url; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Trailers"
ADD CONSTRAINT unique_trailer_url UNIQUE (trailer_url);
--
-- TOC entry 3209 (class 2606 OID 16717)
-- Name: Users users_user_id_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Users"
ADD CONSTRAINT users_user_id_pkey PRIMARY KEY (user_id);
--
-- TOC entry 3219 (class 2606 OID 16773)
-- Name: WatchHistory watch_history_history_id_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."WatchHistory"
ADD CONSTRAINT watch_history_history_id_pkey PRIMARY KEY (history_id);
--
-- TOC entry 3231 (class 2606 OID 16764)
-- Name: Comment comments_content_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Comment"
ADD CONSTRAINT comments_content_id_fkey FOREIGN KEY (content_id) REFERENCES public."Content"(content_id);
--
-- TOC entry 3232 (class 2606 OID 16796)
-- Name: Comment comments_profile_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Comment"
ADD CONSTRAINT comments_profile_id_fkey FOREIGN KEY (profile_id) REFERENCES public."Profiles"(profile_id) NOT VALID;
--
-- TOC entry 3237 (class 2606 OID 16828)
-- Name: Episodes episodes_content_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Episodes"
ADD CONSTRAINT episodes_content_id_fkey FOREIGN KEY (content_id) REFERENCES public."Content"(content_id);
--
-- TOC entry 3238 (class 2606 OID 16833)
-- Name: Episodes episodes_season_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Episodes"
ADD CONSTRAINT episodes_season_id_fkey FOREIGN KEY (season_id) REFERENCES public."Seasons"(season_id);
--
-- TOC entry 3228 (class 2606 OID 16727)
-- Name: Profiles profiles_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Profiles"
ADD CONSTRAINT profiles_user_id_fkey FOREIGN KEY (user_id) REFERENCES public."Users"(user_id);
--
-- TOC entry 3229 (class 2606 OID 16747)
-- Name: Ratings ratings_content_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Ratings"
ADD CONSTRAINT ratings_content_id_fkey FOREIGN KEY (content_id) REFERENCES public."Content"(content_id);
--
-- TOC entry 3230 (class 2606 OID 16801)
-- Name: Ratings ratings_profile_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Ratings"
ADD CONSTRAINT ratings_profile_id_fkey FOREIGN KEY (profile_id) REFERENCES public."Profiles"(profile_id) NOT VALID;
--
-- TOC entry 3236 (class 2606 OID 16816)
-- Name: Seasons seasons_content_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Seasons"
ADD CONSTRAINT seasons_content_id_fkey FOREIGN KEY (content_id) REFERENCES public."Content"(content_id);
--
-- TOC entry 3235 (class 2606 OID 16791)
-- Name: Trailers trailers_content_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Trailers"
ADD CONSTRAINT trailers_content_id_fkey FOREIGN KEY (content_id) REFERENCES public."Content"(content_id);
--
-- TOC entry 3233 (class 2606 OID 16806)
-- Name: WatchHistory watchHistory_profile_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."WatchHistory"
ADD CONSTRAINT "watchHistory_profile_id_fkey" FOREIGN KEY (profile_id) REFERENCES public."Profiles"(profile_id) NOT VALID;
--
-- TOC entry 3234 (class 2606 OID 16779)
-- Name: WatchHistory watch_history_content_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."WatchHistory"
ADD CONSTRAINT watch_history_content_id_fkey FOREIGN KEY (content_id) REFERENCES public."Content"(content_id);
-- Completed on 2026-02-28 15:47:47
--
-- PostgreSQL database dump complete
--