· 5 years ago · Dec 03, 2020, 08:48 AM
1--
2-- PostgreSQL database dump
3--
4
5-- Dumped from database version 12.2 (Debian 12.2-2.pgdg100+1)
6-- Dumped by pg_dump version 12.2
7
8-- Started on 2020-12-03 08:38:32 UTC
9
10SET statement_timeout = 0;
11SET lock_timeout = 0;
12SET idle_in_transaction_session_timeout = 0;
13SET client_encoding = 'UTF8';
14SET standard_conforming_strings = on;
15SELECT pg_catalog.set_config('search_path', '', false);
16SET check_function_bodies = false;
17SET xmloption = content;
18SET client_min_messages = warning;
19SET row_security = off;
20
21--
22-- TOC entry 2 (class 3079 OID 18872)
23-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -
24--
25
26CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;
27
28
29--
30-- TOC entry 3111 (class 0 OID 0)
31-- Dependencies: 2
32-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner:
33--
34
35COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';
36
37
38SET default_tablespace = '';
39
40SET default_table_access_method = heap;
41
42--
43-- TOC entry 214 (class 1259 OID 19028)
44-- Name: classe; Type: TABLE; Schema: public; Owner: postgres
45--
46
47CREATE TABLE public.classe (
48 id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
49 name text NOT NULL,
50 description text NOT NULL,
51 "featuredImage" text NOT NULL,
52 "startTime" timestamp with time zone DEFAULT '2020-11-30 15:36:08.033+07'::timestamp with time zone NOT NULL,
53 "endTime" timestamp with time zone,
54 duration integer,
55 "createdAt" timestamp without time zone DEFAULT now() NOT NULL,
56 "updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
57 type text DEFAULT 'classe'::text NOT NULL,
58 topic uuid,
59 "trainerId" uuid
60);
61
62
63ALTER TABLE public.classe OWNER TO postgres;
64
65--
66-- TOC entry 217 (class 1259 OID 19055)
67-- Name: classe_members_trainee; Type: TABLE; Schema: public; Owner: postgres
68--
69
70CREATE TABLE public.classe_members_trainee (
71 "classeId" uuid NOT NULL,
72 "traineeId" uuid NOT NULL
73);
74
75
76ALTER TABLE public.classe_members_trainee OWNER TO postgres;
77
78--
79-- TOC entry 203 (class 1259 OID 18883)
80-- Name: comment-post; Type: TABLE; Schema: public; Owner: postgres
81--
82
83CREATE TABLE public."comment-post" (
84 id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
85 content text NOT NULL,
86 "createdAt" timestamp without time zone DEFAULT now() NOT NULL,
87 "updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
88 type text DEFAULT 'comment-post'::text NOT NULL,
89 "authorId" uuid NOT NULL,
90 "postId" uuid
91);
92
93
94ALTER TABLE public."comment-post" OWNER TO postgres;
95
96--
97-- TOC entry 206 (class 1259 OID 18919)
98-- Name: comment-question; Type: TABLE; Schema: public; Owner: postgres
99--
100
101CREATE TABLE public."comment-question" (
102 id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
103 content text NOT NULL,
104 "createdAt" timestamp without time zone DEFAULT now() NOT NULL,
105 "updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
106 type text DEFAULT 'comment-question'::text NOT NULL,
107 "authorId" uuid NOT NULL,
108 "questionId" uuid
109);
110
111
112ALTER TABLE public."comment-question" OWNER TO postgres;
113
114--
115-- TOC entry 210 (class 1259 OID 18974)
116-- Name: lesson; Type: TABLE; Schema: public; Owner: postgres
117--
118
119CREATE TABLE public.lesson (
120 id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
121 "startTime" timestamp with time zone DEFAULT '2020-11-30 15:36:08.028+07'::timestamp with time zone NOT NULL,
122 duration integer DEFAULT 60 NOT NULL,
123 name text NOT NULL,
124 type text DEFAULT 'lesson'::text NOT NULL,
125 "createdAt" timestamp without time zone DEFAULT now() NOT NULL,
126 "updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
127 "classeId" uuid
128);
129
130
131ALTER TABLE public.lesson OWNER TO postgres;
132
133--
134-- TOC entry 205 (class 1259 OID 18907)
135-- Name: post; Type: TABLE; Schema: public; Owner: postgres
136--
137
138CREATE TABLE public.post (
139 id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
140 title text NOT NULL,
141 "subTitle" text,
142 "featuredImage" text,
143 "isDraft" boolean NOT NULL,
144 content text NOT NULL,
145 "createdAt" timestamp without time zone DEFAULT now() NOT NULL,
146 "updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
147 type text DEFAULT 'post'::text NOT NULL,
148 "authorId" uuid NOT NULL
149);
150
151
152ALTER TABLE public.post OWNER TO postgres;
153
154--
155-- TOC entry 215 (class 1259 OID 19041)
156-- Name: post_tags_tag-post; Type: TABLE; Schema: public; Owner: postgres
157--
158
159CREATE TABLE public."post_tags_tag-post" (
160 "postId" uuid NOT NULL,
161 "tagPostId" uuid NOT NULL
162);
163
164
165ALTER TABLE public."post_tags_tag-post" OWNER TO postgres;
166
167--
168-- TOC entry 219 (class 1259 OID 19154)
169-- Name: query-result-cache; Type: TABLE; Schema: public; Owner: postgres
170--
171
172CREATE TABLE public."query-result-cache" (
173 id integer NOT NULL,
174 identifier character varying,
175 "time" bigint NOT NULL,
176 duration integer NOT NULL,
177 query text NOT NULL,
178 result text NOT NULL
179);
180
181
182ALTER TABLE public."query-result-cache" OWNER TO postgres;
183
184--
185-- TOC entry 218 (class 1259 OID 19152)
186-- Name: query-result-cache_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
187--
188
189CREATE SEQUENCE public."query-result-cache_id_seq"
190 AS integer
191 START WITH 1
192 INCREMENT BY 1
193 NO MINVALUE
194 NO MAXVALUE
195 CACHE 1;
196
197
198ALTER TABLE public."query-result-cache_id_seq" OWNER TO postgres;
199
200--
201-- TOC entry 3112 (class 0 OID 0)
202-- Dependencies: 218
203-- Name: query-result-cache_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
204--
205
206ALTER SEQUENCE public."query-result-cache_id_seq" OWNED BY public."query-result-cache".id;
207
208
209--
210-- TOC entry 208 (class 1259 OID 18943)
211-- Name: question; Type: TABLE; Schema: public; Owner: postgres
212--
213
214CREATE TABLE public.question (
215 id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
216 title text NOT NULL,
217 content text NOT NULL,
218 "createdAt" timestamp without time zone DEFAULT now() NOT NULL,
219 "updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
220 type text DEFAULT 'question'::text NOT NULL,
221 "authorId" uuid NOT NULL
222);
223
224
225ALTER TABLE public.question OWNER TO postgres;
226
227--
228-- TOC entry 216 (class 1259 OID 19048)
229-- Name: question_tags_tag-question; Type: TABLE; Schema: public; Owner: postgres
230--
231
232CREATE TABLE public."question_tags_tag-question" (
233 "questionId" uuid NOT NULL,
234 "tagQuestionId" uuid NOT NULL
235);
236
237
238ALTER TABLE public."question_tags_tag-question" OWNER TO postgres;
239
240--
241-- TOC entry 204 (class 1259 OID 18895)
242-- Name: tag-post; Type: TABLE; Schema: public; Owner: postgres
243--
244
245CREATE TABLE public."tag-post" (
246 id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
247 name text NOT NULL,
248 "createdAt" timestamp without time zone DEFAULT now() NOT NULL,
249 "updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
250 type text DEFAULT 'tag-post'::text NOT NULL
251);
252
253
254ALTER TABLE public."tag-post" OWNER TO postgres;
255
256--
257-- TOC entry 207 (class 1259 OID 18931)
258-- Name: tag-question; Type: TABLE; Schema: public; Owner: postgres
259--
260
261CREATE TABLE public."tag-question" (
262 id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
263 name text NOT NULL,
264 "createdAt" timestamp without time zone DEFAULT now() NOT NULL,
265 "updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
266 type text DEFAULT 'tag-question'::text NOT NULL
267);
268
269
270ALTER TABLE public."tag-question" OWNER TO postgres;
271
272--
273-- TOC entry 212 (class 1259 OID 19002)
274-- Name: topic; Type: TABLE; Schema: public; Owner: postgres
275--
276
277CREATE TABLE public.topic (
278 id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
279 name text NOT NULL,
280 description text NOT NULL,
281 "featuredImage" text NOT NULL,
282 "createdAt" timestamp without time zone DEFAULT now() NOT NULL,
283 "updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
284 type text DEFAULT 'topic'::text NOT NULL,
285 "authorId" uuid
286);
287
288
289ALTER TABLE public.topic OWNER TO postgres;
290
291--
292-- TOC entry 213 (class 1259 OID 19014)
293-- Name: trainee; Type: TABLE; Schema: public; Owner: postgres
294--
295
296CREATE TABLE public.trainee (
297 id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
298 "traineeProfile" text,
299 "createdAt" timestamp without time zone DEFAULT now() NOT NULL,
300 "updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
301 type text DEFAULT 'trainee'::text NOT NULL,
302 "user" uuid
303);
304
305
306ALTER TABLE public.trainee OWNER TO postgres;
307
308--
309-- TOC entry 211 (class 1259 OID 18988)
310-- Name: trainer; Type: TABLE; Schema: public; Owner: postgres
311--
312
313CREATE TABLE public.trainer (
314 id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
315 "trainerProfile" text,
316 "createdAt" timestamp without time zone DEFAULT now() NOT NULL,
317 "updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
318 type text DEFAULT 'trainer'::text NOT NULL,
319 "user" uuid
320);
321
322
323ALTER TABLE public.trainer OWNER TO postgres;
324
325--
326-- TOC entry 209 (class 1259 OID 18955)
327-- Name: user; Type: TABLE; Schema: public; Owner: postgres
328--
329
330CREATE TABLE public."user" (
331 id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
332 email text,
333 "phoneNumber" text,
334 "avatarUrl" text,
335 name text NOT NULL,
336 username text NOT NULL,
337 password text NOT NULL,
338 roles text DEFAULT 'TRAINEE'::text NOT NULL,
339 "createdAt" timestamp without time zone DEFAULT now() NOT NULL,
340 "updatedAt" timestamp without time zone DEFAULT now() NOT NULL,
341 type text DEFAULT 'user'::text NOT NULL
342);
343
344
345ALTER TABLE public."user" OWNER TO postgres;
346
347--
348-- TOC entry 2913 (class 2604 OID 19157)
349-- Name: query-result-cache id; Type: DEFAULT; Schema: public; Owner: postgres
350--
351
352ALTER TABLE ONLY public."query-result-cache" ALTER COLUMN id SET DEFAULT nextval('public."query-result-cache_id_seq"'::regclass);
353
354
355--
356-- TOC entry 2935 (class 2606 OID 18987)
357-- Name: lesson PK_0ef25918f0237e68696dee455bd; Type: CONSTRAINT; Schema: public; Owner: postgres
358--
359
360ALTER TABLE ONLY public.lesson
361 ADD CONSTRAINT "PK_0ef25918f0237e68696dee455bd" PRIMARY KEY (id);
362
363
364--
365-- TOC entry 2925 (class 2606 OID 18954)
366-- Name: question PK_21e5786aa0ea704ae185a79b2d5; Type: CONSTRAINT; Schema: public; Owner: postgres
367--
368
369ALTER TABLE ONLY public.question
370 ADD CONSTRAINT "PK_21e5786aa0ea704ae185a79b2d5" PRIMARY KEY (id);
371
372
373--
374-- TOC entry 2941 (class 2606 OID 19013)
375-- Name: topic PK_33aa4ecb4e4f20aa0157ea7ef61; Type: CONSTRAINT; Schema: public; Owner: postgres
376--
377
378ALTER TABLE ONLY public.topic
379 ADD CONSTRAINT "PK_33aa4ecb4e4f20aa0157ea7ef61" PRIMARY KEY (id);
380
381
382--
383-- TOC entry 2915 (class 2606 OID 18894)
384-- Name: comment-post PK_3b01685b3a2b781c4de37bf4e05; Type: CONSTRAINT; Schema: public; Owner: postgres
385--
386
387ALTER TABLE ONLY public."comment-post"
388 ADD CONSTRAINT "PK_3b01685b3a2b781c4de37bf4e05" PRIMARY KEY (id);
389
390
391--
392-- TOC entry 2917 (class 2606 OID 18906)
393-- Name: tag-post PK_69c5e793f490c8d69e93f7c6147; Type: CONSTRAINT; Schema: public; Owner: postgres
394--
395
396ALTER TABLE ONLY public."tag-post"
397 ADD CONSTRAINT "PK_69c5e793f490c8d69e93f7c6147" PRIMARY KEY (id);
398
399
400--
401-- TOC entry 2961 (class 2606 OID 19162)
402-- Name: query-result-cache PK_6a98f758d8bfd010e7e10ffd3d3; Type: CONSTRAINT; Schema: public; Owner: postgres
403--
404
405ALTER TABLE ONLY public."query-result-cache"
406 ADD CONSTRAINT "PK_6a98f758d8bfd010e7e10ffd3d3" PRIMARY KEY (id);
407
408
409--
410-- TOC entry 2943 (class 2606 OID 19025)
411-- Name: trainee PK_7bb8bcb39effdfc30d4f67e9eb8; Type: CONSTRAINT; Schema: public; Owner: postgres
412--
413
414ALTER TABLE ONLY public.trainee
415 ADD CONSTRAINT "PK_7bb8bcb39effdfc30d4f67e9eb8" PRIMARY KEY (id);
416
417
418--
419-- TOC entry 2959 (class 2606 OID 19059)
420-- Name: classe_members_trainee PK_82b32c27d6135eed21a3a0e71ad; Type: CONSTRAINT; Schema: public; Owner: postgres
421--
422
423ALTER TABLE ONLY public.classe_members_trainee
424 ADD CONSTRAINT "PK_82b32c27d6135eed21a3a0e71ad" PRIMARY KEY ("classeId", "traineeId");
425
426
427--
428-- TOC entry 2921 (class 2606 OID 18930)
429-- Name: comment-question PK_83dea648d6c51e64accdc2ca993; Type: CONSTRAINT; Schema: public; Owner: postgres
430--
431
432ALTER TABLE ONLY public."comment-question"
433 ADD CONSTRAINT "PK_83dea648d6c51e64accdc2ca993" PRIMARY KEY (id);
434
435
436--
437-- TOC entry 2937 (class 2606 OID 18999)
438-- Name: trainer PK_8dfa741df6d52a0da8ad93f0c7e; Type: CONSTRAINT; Schema: public; Owner: postgres
439--
440
441ALTER TABLE ONLY public.trainer
442 ADD CONSTRAINT "PK_8dfa741df6d52a0da8ad93f0c7e" PRIMARY KEY (id);
443
444
445--
446-- TOC entry 2923 (class 2606 OID 18942)
447-- Name: tag-question PK_ba5db5786a057cd62aa425d09b0; Type: CONSTRAINT; Schema: public; Owner: postgres
448--
449
450ALTER TABLE ONLY public."tag-question"
451 ADD CONSTRAINT "PK_ba5db5786a057cd62aa425d09b0" PRIMARY KEY (id);
452
453
454--
455-- TOC entry 2919 (class 2606 OID 18918)
456-- Name: post PK_be5fda3aac270b134ff9c21cdee; Type: CONSTRAINT; Schema: public; Owner: postgres
457--
458
459ALTER TABLE ONLY public.post
460 ADD CONSTRAINT "PK_be5fda3aac270b134ff9c21cdee" PRIMARY KEY (id);
461
462
463--
464-- TOC entry 2927 (class 2606 OID 18967)
465-- Name: user PK_cace4a159ff9f2512dd42373760; Type: CONSTRAINT; Schema: public; Owner: postgres
466--
467
468ALTER TABLE ONLY public."user"
469 ADD CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY (id);
470
471
472--
473-- TOC entry 2951 (class 2606 OID 19045)
474-- Name: post_tags_tag-post PK_e371b0005607f2e967886168ad3; Type: CONSTRAINT; Schema: public; Owner: postgres
475--
476
477ALTER TABLE ONLY public."post_tags_tag-post"
478 ADD CONSTRAINT "PK_e371b0005607f2e967886168ad3" PRIMARY KEY ("postId", "tagPostId");
479
480
481--
482-- TOC entry 2955 (class 2606 OID 19052)
483-- Name: question_tags_tag-question PK_f4e01eb305c3c124ede6555e6c5; Type: CONSTRAINT; Schema: public; Owner: postgres
484--
485
486ALTER TABLE ONLY public."question_tags_tag-question"
487 ADD CONSTRAINT "PK_f4e01eb305c3c124ede6555e6c5" PRIMARY KEY ("questionId", "tagQuestionId");
488
489
490--
491-- TOC entry 2947 (class 2606 OID 19040)
492-- Name: classe PK_f5164b0fb85545cd6d8e86b6b70; Type: CONSTRAINT; Schema: public; Owner: postgres
493--
494
495ALTER TABLE ONLY public.classe
496 ADD CONSTRAINT "PK_f5164b0fb85545cd6d8e86b6b70" PRIMARY KEY (id);
497
498
499--
500-- TOC entry 2939 (class 2606 OID 19001)
501-- Name: trainer REL_c4ce58193d721320abff1013b7; Type: CONSTRAINT; Schema: public; Owner: postgres
502--
503
504ALTER TABLE ONLY public.trainer
505 ADD CONSTRAINT "REL_c4ce58193d721320abff1013b7" UNIQUE ("user");
506
507
508--
509-- TOC entry 2945 (class 2606 OID 19027)
510-- Name: trainee REL_dba19d38e0dc54b6f91b536dc5; Type: CONSTRAINT; Schema: public; Owner: postgres
511--
512
513ALTER TABLE ONLY public.trainee
514 ADD CONSTRAINT "REL_dba19d38e0dc54b6f91b536dc5" UNIQUE ("user");
515
516
517--
518-- TOC entry 2929 (class 2606 OID 18973)
519-- Name: user UQ_78a916df40e02a9deb1c4b75edb; Type: CONSTRAINT; Schema: public; Owner: postgres
520--
521
522ALTER TABLE ONLY public."user"
523 ADD CONSTRAINT "UQ_78a916df40e02a9deb1c4b75edb" UNIQUE (username);
524
525
526--
527-- TOC entry 2931 (class 2606 OID 18969)
528-- Name: user UQ_e12875dfb3b1d92d7d7c5377e22; Type: CONSTRAINT; Schema: public; Owner: postgres
529--
530
531ALTER TABLE ONLY public."user"
532 ADD CONSTRAINT "UQ_e12875dfb3b1d92d7d7c5377e22" UNIQUE (email);
533
534
535--
536-- TOC entry 2933 (class 2606 OID 18971)
537-- Name: user UQ_f2578043e491921209f5dadd080; Type: CONSTRAINT; Schema: public; Owner: postgres
538--
539
540ALTER TABLE ONLY public."user"
541 ADD CONSTRAINT "UQ_f2578043e491921209f5dadd080" UNIQUE ("phoneNumber");
542
543
544--
545-- TOC entry 2952 (class 1259 OID 19054)
546-- Name: IDX_086d6072209571a9b2037abd24; Type: INDEX; Schema: public; Owner: postgres
547--
548
549CREATE INDEX "IDX_086d6072209571a9b2037abd24" ON public."question_tags_tag-question" USING btree ("tagQuestionId");
550
551
552--
553-- TOC entry 2948 (class 1259 OID 19046)
554-- Name: IDX_0f83bdccfb4a4227954c7f2eae; Type: INDEX; Schema: public; Owner: postgres
555--
556
557CREATE INDEX "IDX_0f83bdccfb4a4227954c7f2eae" ON public."post_tags_tag-post" USING btree ("postId");
558
559
560--
561-- TOC entry 2949 (class 1259 OID 19047)
562-- Name: IDX_3b74e28b668f4ccd26ce6a9b76; Type: INDEX; Schema: public; Owner: postgres
563--
564
565CREATE INDEX "IDX_3b74e28b668f4ccd26ce6a9b76" ON public."post_tags_tag-post" USING btree ("tagPostId");
566
567
568--
569-- TOC entry 2956 (class 1259 OID 19061)
570-- Name: IDX_8cd84c04d2a10d819bffd32a54; Type: INDEX; Schema: public; Owner: postgres
571--
572
573CREATE INDEX "IDX_8cd84c04d2a10d819bffd32a54" ON public.classe_members_trainee USING btree ("traineeId");
574
575
576--
577-- TOC entry 2957 (class 1259 OID 19060)
578-- Name: IDX_e06b45d2733c68c205ee2e028a; Type: INDEX; Schema: public; Owner: postgres
579--
580
581CREATE INDEX "IDX_e06b45d2733c68c205ee2e028a" ON public.classe_members_trainee USING btree ("classeId");
582
583
584--
585-- TOC entry 2953 (class 1259 OID 19053)
586-- Name: IDX_f2479eaa14b7268b941e820b3a; Type: INDEX; Schema: public; Owner: postgres
587--
588
589CREATE INDEX "IDX_f2479eaa14b7268b941e820b3a" ON public."question_tags_tag-question" USING btree ("questionId");
590
591
592--
593-- TOC entry 2977 (class 2606 OID 19137)
594-- Name: question_tags_tag-question FK_086d6072209571a9b2037abd247; Type: FK CONSTRAINT; Schema: public; Owner: postgres
595--
596
597ALTER TABLE ONLY public."question_tags_tag-question"
598 ADD CONSTRAINT "FK_086d6072209571a9b2037abd247" FOREIGN KEY ("tagQuestionId") REFERENCES public."tag-question"(id) ON DELETE CASCADE;
599
600
601--
602-- TOC entry 2974 (class 2606 OID 19122)
603-- Name: post_tags_tag-post FK_0f83bdccfb4a4227954c7f2eae0; Type: FK CONSTRAINT; Schema: public; Owner: postgres
604--
605
606ALTER TABLE ONLY public."post_tags_tag-post"
607 ADD CONSTRAINT "FK_0f83bdccfb4a4227954c7f2eae0" FOREIGN KEY ("postId") REFERENCES public.post(id) ON DELETE CASCADE;
608
609
610--
611-- TOC entry 2963 (class 2606 OID 19067)
612-- Name: comment-post FK_161abf98e07e7c322ccf7e99f1c; Type: FK CONSTRAINT; Schema: public; Owner: postgres
613--
614
615ALTER TABLE ONLY public."comment-post"
616 ADD CONSTRAINT "FK_161abf98e07e7c322ccf7e99f1c" FOREIGN KEY ("postId") REFERENCES public.post(id) ON DELETE CASCADE;
617
618
619--
620-- TOC entry 2975 (class 2606 OID 19127)
621-- Name: post_tags_tag-post FK_3b74e28b668f4ccd26ce6a9b76b; Type: FK CONSTRAINT; Schema: public; Owner: postgres
622--
623
624ALTER TABLE ONLY public."post_tags_tag-post"
625 ADD CONSTRAINT "FK_3b74e28b668f4ccd26ce6a9b76b" FOREIGN KEY ("tagPostId") REFERENCES public."tag-post"(id) ON DELETE CASCADE;
626
627
628--
629-- TOC entry 2965 (class 2606 OID 19077)
630-- Name: comment-question FK_43881ccf1c335efb856bb7bc848; Type: FK CONSTRAINT; Schema: public; Owner: postgres
631--
632
633ALTER TABLE ONLY public."comment-question"
634 ADD CONSTRAINT "FK_43881ccf1c335efb856bb7bc848" FOREIGN KEY ("authorId") REFERENCES public."user"(id);
635
636
637--
638-- TOC entry 2962 (class 2606 OID 19062)
639-- Name: comment-post FK_53cfd834f38ebd63ae291efdd4b; Type: FK CONSTRAINT; Schema: public; Owner: postgres
640--
641
642ALTER TABLE ONLY public."comment-post"
643 ADD CONSTRAINT "FK_53cfd834f38ebd63ae291efdd4b" FOREIGN KEY ("authorId") REFERENCES public."user"(id);
644
645
646--
647-- TOC entry 2970 (class 2606 OID 19102)
648-- Name: topic FK_5bc4974a5ec06dd10c348bdb5ec; Type: FK CONSTRAINT; Schema: public; Owner: postgres
649--
650
651ALTER TABLE ONLY public.topic
652 ADD CONSTRAINT "FK_5bc4974a5ec06dd10c348bdb5ec" FOREIGN KEY ("authorId") REFERENCES public.trainer(id);
653
654
655--
656-- TOC entry 2972 (class 2606 OID 19112)
657-- Name: classe FK_6f7a369cd9dc3a067a1bdb256fe; Type: FK CONSTRAINT; Schema: public; Owner: postgres
658--
659
660ALTER TABLE ONLY public.classe
661 ADD CONSTRAINT "FK_6f7a369cd9dc3a067a1bdb256fe" FOREIGN KEY (topic) REFERENCES public.topic(id);
662
663
664--
665-- TOC entry 2967 (class 2606 OID 19087)
666-- Name: question FK_75fc761f2752712276be38e7d13; Type: FK CONSTRAINT; Schema: public; Owner: postgres
667--
668
669ALTER TABLE ONLY public.question
670 ADD CONSTRAINT "FK_75fc761f2752712276be38e7d13" FOREIGN KEY ("authorId") REFERENCES public."user"(id);
671
672
673--
674-- TOC entry 2979 (class 2606 OID 19147)
675-- Name: classe_members_trainee FK_8cd84c04d2a10d819bffd32a548; Type: FK CONSTRAINT; Schema: public; Owner: postgres
676--
677
678ALTER TABLE ONLY public.classe_members_trainee
679 ADD CONSTRAINT "FK_8cd84c04d2a10d819bffd32a548" FOREIGN KEY ("traineeId") REFERENCES public.trainee(id) ON DELETE CASCADE;
680
681
682--
683-- TOC entry 2966 (class 2606 OID 19082)
684-- Name: comment-question FK_b9559873ef6d184d9003f8fb1f0; Type: FK CONSTRAINT; Schema: public; Owner: postgres
685--
686
687ALTER TABLE ONLY public."comment-question"
688 ADD CONSTRAINT "FK_b9559873ef6d184d9003f8fb1f0" FOREIGN KEY ("questionId") REFERENCES public.question(id) ON DELETE CASCADE;
689
690
691--
692-- TOC entry 2969 (class 2606 OID 19097)
693-- Name: trainer FK_c4ce58193d721320abff1013b7a; Type: FK CONSTRAINT; Schema: public; Owner: postgres
694--
695
696ALTER TABLE ONLY public.trainer
697 ADD CONSTRAINT "FK_c4ce58193d721320abff1013b7a" FOREIGN KEY ("user") REFERENCES public."user"(id);
698
699
700--
701-- TOC entry 2964 (class 2606 OID 19072)
702-- Name: post FK_c6fb082a3114f35d0cc27c518e0; Type: FK CONSTRAINT; Schema: public; Owner: postgres
703--
704
705ALTER TABLE ONLY public.post
706 ADD CONSTRAINT "FK_c6fb082a3114f35d0cc27c518e0" FOREIGN KEY ("authorId") REFERENCES public."user"(id) ON DELETE CASCADE;
707
708
709--
710-- TOC entry 2971 (class 2606 OID 19107)
711-- Name: trainee FK_dba19d38e0dc54b6f91b536dc5c; Type: FK CONSTRAINT; Schema: public; Owner: postgres
712--
713
714ALTER TABLE ONLY public.trainee
715 ADD CONSTRAINT "FK_dba19d38e0dc54b6f91b536dc5c" FOREIGN KEY ("user") REFERENCES public."user"(id);
716
717
718--
719-- TOC entry 2978 (class 2606 OID 19142)
720-- Name: classe_members_trainee FK_e06b45d2733c68c205ee2e028ac; Type: FK CONSTRAINT; Schema: public; Owner: postgres
721--
722
723ALTER TABLE ONLY public.classe_members_trainee
724 ADD CONSTRAINT "FK_e06b45d2733c68c205ee2e028ac" FOREIGN KEY ("classeId") REFERENCES public.classe(id) ON DELETE CASCADE;
725
726
727--
728-- TOC entry 2973 (class 2606 OID 19117)
729-- Name: classe FK_e95d1ff4fdba7f3f9d30fb6682d; Type: FK CONSTRAINT; Schema: public; Owner: postgres
730--
731
732ALTER TABLE ONLY public.classe
733 ADD CONSTRAINT "FK_e95d1ff4fdba7f3f9d30fb6682d" FOREIGN KEY ("trainerId") REFERENCES public.trainer(id);
734
735
736--
737-- TOC entry 2976 (class 2606 OID 19132)
738-- Name: question_tags_tag-question FK_f2479eaa14b7268b941e820b3a3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
739--
740
741ALTER TABLE ONLY public."question_tags_tag-question"
742 ADD CONSTRAINT "FK_f2479eaa14b7268b941e820b3a3" FOREIGN KEY ("questionId") REFERENCES public.question(id) ON DELETE CASCADE;
743
744
745--
746-- TOC entry 2968 (class 2606 OID 19092)
747-- Name: lesson FK_f8129e3c7eacda851f01f054f96; Type: FK CONSTRAINT; Schema: public; Owner: postgres
748--
749
750ALTER TABLE ONLY public.lesson
751 ADD CONSTRAINT "FK_f8129e3c7eacda851f01f054f96" FOREIGN KEY ("classeId") REFERENCES public.classe(id);
752
753
754-- Completed on 2020-12-03 08:38:32 UTC
755
756--
757-- PostgreSQL database dump complete
758--
759
760