-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup.sql
More file actions
779 lines (533 loc) · 45.3 KB
/
Copy pathbackup.sql
File metadata and controls
779 lines (533 loc) · 45.3 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
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
--
-- PostgreSQL database dump
--
\restrict e6YMwlptnUyAqqaoxJSyCqXM9ARmyRMQiR29BQeKfkVyBKvx3F3TSw6H6CPNuyJ
-- Dumped from database version 18.3 (Debian 18.3-1.pgdg13+1)
-- Dumped by pg_dump version 18.3
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_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: acting_hod_assignments; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.acting_hod_assignments (
id integer NOT NULL,
department_id integer,
original_hod_id integer,
acting_hod_id integer,
from_date date,
to_date date,
active boolean DEFAULT true
);
ALTER TABLE public.acting_hod_assignments OWNER TO postgres;
--
-- Name: acting_hod_assignments_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.acting_hod_assignments_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.acting_hod_assignments_id_seq OWNER TO postgres;
--
-- Name: acting_hod_assignments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.acting_hod_assignments_id_seq OWNED BY public.acting_hod_assignments.id;
--
-- Name: departments; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.departments (
id integer NOT NULL,
name character varying(100) NOT NULL,
hod_id integer
);
ALTER TABLE public.departments OWNER TO postgres;
--
-- Name: departments_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.departments_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.departments_id_seq OWNER TO postgres;
--
-- Name: departments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.departments_id_seq OWNED BY public.departments.id;
--
-- Name: dept_scores; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.dept_scores (
id integer NOT NULL,
department_id integer,
date date,
score integer
);
ALTER TABLE public.dept_scores OWNER TO postgres;
--
-- Name: dept_scores_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.dept_scores_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.dept_scores_id_seq OWNER TO postgres;
--
-- Name: dept_scores_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.dept_scores_id_seq OWNED BY public.dept_scores.id;
--
-- Name: impact_logs; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.impact_logs (
id integer NOT NULL,
leave_id integer,
affected_classes integer,
unresolved_classes integer,
overload_score numeric(5,2)
);
ALTER TABLE public.impact_logs OWNER TO postgres;
--
-- Name: impact_logs_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.impact_logs_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.impact_logs_id_seq OWNER TO postgres;
--
-- Name: impact_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.impact_logs_id_seq OWNED BY public.impact_logs.id;
--
-- Name: leave_requests; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.leave_requests (
id integer NOT NULL,
faculty_id integer,
department_id integer,
from_date date,
to_date date,
reason text,
status character varying(20) DEFAULT 'pending'::character varying,
impact_score numeric(5,2) DEFAULT 0,
is_hod_leave boolean DEFAULT false,
acting_hod_id integer,
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT leave_requests_status_check CHECK (((status)::text = ANY ((ARRAY['pending'::character varying, 'approved'::character varying, 'rejected'::character varying])::text[])))
);
ALTER TABLE public.leave_requests OWNER TO postgres;
--
-- Name: leave_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.leave_requests_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.leave_requests_id_seq OWNER TO postgres;
--
-- Name: leave_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.leave_requests_id_seq OWNED BY public.leave_requests.id;
--
-- Name: substitutions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.substitutions (
id integer NOT NULL,
leave_id integer,
original_faculty_id integer,
substitute_faculty_id integer,
class_id character varying(20),
subject character varying(150),
day character varying(20),
start_time character varying(10),
end_time character varying(10),
date date,
status character varying(20),
CONSTRAINT substitutions_status_check CHECK (((status)::text = ANY ((ARRAY['assigned'::character varying, 'accepted'::character varying, 'rejected'::character varying])::text[])))
);
ALTER TABLE public.substitutions OWNER TO postgres;
--
-- Name: substitutions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.substitutions_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.substitutions_id_seq OWNER TO postgres;
--
-- Name: substitutions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.substitutions_id_seq OWNED BY public.substitutions.id;
--
-- Name: timetable; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.timetable (
id integer NOT NULL,
faculty_id integer,
subject character varying(150),
day character varying(20),
start_time character varying(10),
end_time character varying(10),
class_id character varying(20)
);
ALTER TABLE public.timetable OWNER TO postgres;
--
-- Name: timetable_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.timetable_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.timetable_id_seq OWNER TO postgres;
--
-- Name: timetable_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.timetable_id_seq OWNED BY public.timetable.id;
--
-- Name: users; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.users (
id integer NOT NULL,
name character varying(150) NOT NULL,
email character varying(150) NOT NULL,
password text NOT NULL,
role character varying(20) NOT NULL,
department_id integer,
skills text[],
max_leaves integer DEFAULT 12,
leaves_taken integer DEFAULT 0,
acting_role character varying(20)
);
ALTER TABLE public.users OWNER TO postgres;
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.users_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.users_id_seq OWNER TO postgres;
--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
--
-- Name: acting_hod_assignments id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.acting_hod_assignments ALTER COLUMN id SET DEFAULT nextval('public.acting_hod_assignments_id_seq'::regclass);
--
-- Name: departments id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.departments ALTER COLUMN id SET DEFAULT nextval('public.departments_id_seq'::regclass);
--
-- Name: dept_scores id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.dept_scores ALTER COLUMN id SET DEFAULT nextval('public.dept_scores_id_seq'::regclass);
--
-- Name: impact_logs id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.impact_logs ALTER COLUMN id SET DEFAULT nextval('public.impact_logs_id_seq'::regclass);
--
-- Name: leave_requests id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.leave_requests ALTER COLUMN id SET DEFAULT nextval('public.leave_requests_id_seq'::regclass);
--
-- Name: substitutions id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.substitutions ALTER COLUMN id SET DEFAULT nextval('public.substitutions_id_seq'::regclass);
--
-- Name: timetable id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.timetable ALTER COLUMN id SET DEFAULT nextval('public.timetable_id_seq'::regclass);
--
-- Name: users id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
--
-- Data for Name: acting_hod_assignments; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.acting_hod_assignments (id, department_id, original_hod_id, acting_hod_id, from_date, to_date, active) FROM stdin;
\.
--
-- Data for Name: departments; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.departments (id, name, hod_id) FROM stdin;
1 Computer Science 9
2 Mathematics 10
3 Electronics 11
4 Mechanical 12
\.
--
-- Data for Name: dept_scores; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.dept_scores (id, department_id, date, score) FROM stdin;
1 1 2025-04-01 87
2 1 2025-04-07 91
3 1 2025-04-14 78
4 2 2025-04-01 95
5 2 2025-04-07 88
6 2 2025-04-14 92
7 3 2025-04-01 72
8 3 2025-04-07 80
9 3 2025-04-14 85
10 4 2025-04-01 68
11 4 2025-04-07 74
12 4 2025-04-14 70
\.
--
-- Data for Name: impact_logs; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.impact_logs (id, leave_id, affected_classes, unresolved_classes, overload_score) FROM stdin;
1 1 2 0 1.20
\.
--
-- Data for Name: leave_requests; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.leave_requests (id, faculty_id, department_id, from_date, to_date, reason, status, impact_score, is_hod_leave, acting_hod_id, created_at) FROM stdin;
1 1 1 2025-04-10 2025-04-11 Medical appointment approved 4.20 f \N 2026-04-17 16:03:02.970972
2 2 1 2025-04-14 2025-04-14 Family function pending 2.80 f \N 2026-04-17 16:03:02.970972
3 3 2 2025-04-17 2025-04-18 Conference approved 3.50 f \N 2026-04-17 16:03:02.970972
\.
--
-- Data for Name: substitutions; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.substitutions (id, leave_id, original_faculty_id, substitute_faculty_id, class_id, subject, day, start_time, end_time, date, status) FROM stdin;
1 1 1 5 CS-301 Data Structures Monday 09:00 10:00 2025-04-10 accepted
\.
--
-- Data for Name: timetable; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.timetable (id, faculty_id, subject, day, start_time, end_time, class_id) FROM stdin;
1 1 Data Structures Monday 09:00 10:00 CS-301
2 1 Data Structures Wednesday 09:00 10:00 CS-301
3 1 Algorithms Friday 11:00 12:00 CS-401
4 2 Database Systems Monday 10:00 11:00 CS-302
5 2 Database Systems Thursday 10:00 11:00 CS-302
6 2 Data Structures Tuesday 09:00 10:00 CS-303
7 3 Calculus Monday 11:00 12:00 MA-101
8 3 Linear Algebra Wednesday 14:00 15:00 MA-201
9 4 Digital Electronics Tuesday 11:00 12:00 EC-201
10 4 Signals & Systems Thursday 14:00 15:00 EC-301
11 5 Algorithms Monday 14:00 15:00 CS-402
12 5 Data Structures Friday 09:00 10:00 CS-304
13 6 Probability Tuesday 14:00 15:00 MA-301
14 6 Calculus Thursday 09:00 10:00 MA-102
15 7 Thermodynamics Monday 09:00 10:00 ME-201
16 7 Fluid Mechanics Wednesday 11:00 12:00 ME-301
17 8 Operating Systems Tuesday 10:00 11:00 CS-305
18 8 Computer Networks Friday 14:00 15:00 CS-405
\.
--
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.users (id, name, email, password, role, department_id, skills, max_leaves, leaves_taken, acting_role) FROM stdin;
2 Prof. Sunita Rao sunita@college.edu 7cb3195e091d14a37737a2c9a99f78e4db11ba18fb010ffd2a2ce04c7440cc850a2b3d225981db0c2d3bbd21f06dd001d28dd65df7d328846c900261f99f1e17 faculty 1 {databases,"system design"} 12 1 \N
3 Dr. Kiran Desai kiran@college.edu 7cb3195e091d14a37737a2c9a99f78e4db11ba18fb010ffd2a2ce04c7440cc850a2b3d225981db0c2d3bbd21f06dd001d28dd65df7d328846c900261f99f1e17 faculty 2 {calculus,"linear algebra"} 12 1 \N
4 Prof. Meena Iyer meena@college.edu 7cb3195e091d14a37737a2c9a99f78e4db11ba18fb010ffd2a2ce04c7440cc850a2b3d225981db0c2d3bbd21f06dd001d28dd65df7d328846c900261f99f1e17 faculty 3 {"digital electronics",signals} 12 0 \N
5 Dr. Rajan Pillai rajan@college.edu 7cb3195e091d14a37737a2c9a99f78e4db11ba18fb010ffd2a2ce04c7440cc850a2b3d225981db0c2d3bbd21f06dd001d28dd65df7d328846c900261f99f1e17 faculty 1 {algorithms,"operating systems"} 12 0 \N
6 Prof. Divya Nair divya@college.edu 7cb3195e091d14a37737a2c9a99f78e4db11ba18fb010ffd2a2ce04c7440cc850a2b3d225981db0c2d3bbd21f06dd001d28dd65df7d328846c900261f99f1e17 faculty 2 {probability,calculus} 12 0 \N
7 Dr. Sanjay Gupta sanjay@college.edu 7cb3195e091d14a37737a2c9a99f78e4db11ba18fb010ffd2a2ce04c7440cc850a2b3d225981db0c2d3bbd21f06dd001d28dd65df7d328846c900261f99f1e17 faculty 4 {thermodynamics,"fluid mechanics"} 12 0 \N
8 Prof. Priya Kumar priya@college.edu 7cb3195e091d14a37737a2c9a99f78e4db11ba18fb010ffd2a2ce04c7440cc850a2b3d225981db0c2d3bbd21f06dd001d28dd65df7d328846c900261f99f1e17 faculty 1 {"operating systems","computer networks"} 12 0 \N
9 Dr. Nikhil Verma nikhil@college.edu 7cb3195e091d14a37737a2c9a99f78e4db11ba18fb010ffd2a2ce04c7440cc850a2b3d225981db0c2d3bbd21f06dd001d28dd65df7d328846c900261f99f1e17 hod 1 {"academic leadership"} 12 0 \N
10 Dr. Meera Joshi meera@college.edu 7cb3195e091d14a37737a2c9a99f78e4db11ba18fb010ffd2a2ce04c7440cc850a2b3d225981db0c2d3bbd21f06dd001d28dd65df7d328846c900261f99f1e17 hod 2 {"academic leadership"} 12 0 \N
11 Dr. Rohit Sharma rohit@college.edu 7cb3195e091d14a37737a2c9a99f78e4db11ba18fb010ffd2a2ce04c7440cc850a2b3d225981db0c2d3bbd21f06dd001d28dd65df7d328846c900261f99f1e17 hod 3 {"academic leadership"} 12 0 \N
12 Dr. Anjali Gupta anjali@college.edu 7cb3195e091d14a37737a2c9a99f78e4db11ba18fb010ffd2a2ce04c7440cc850a2b3d225981db0c2d3bbd21f06dd001d28dd65df7d328846c900261f99f1e17 hod 4 {"academic leadership"} 12 0 \N
1 Dr. Arjun Mehta arjun@college.edu 7cb3195e091d14a37737a2c9a99f78e4db11ba18fb010ffd2a2ce04c7440cc850a2b3d225981db0c2d3bbd21f06dd001d28dd65df7d328846c900261f99f1e17 faculty 1 {"data structures",algorithms} 12 2 \N
\.
--
-- Name: acting_hod_assignments_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.acting_hod_assignments_id_seq', 1, false);
--
-- Name: departments_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.departments_id_seq', 4, true);
--
-- Name: dept_scores_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.dept_scores_id_seq', 12, true);
--
-- Name: impact_logs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.impact_logs_id_seq', 1, true);
--
-- Name: leave_requests_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.leave_requests_id_seq', 3, true);
--
-- Name: substitutions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.substitutions_id_seq', 1, true);
--
-- Name: timetable_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.timetable_id_seq', 1, false);
--
-- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.users_id_seq', 12, true);
--
-- Name: acting_hod_assignments acting_hod_assignments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.acting_hod_assignments
ADD CONSTRAINT acting_hod_assignments_pkey PRIMARY KEY (id);
--
-- Name: departments departments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.departments
ADD CONSTRAINT departments_pkey PRIMARY KEY (id);
--
-- Name: dept_scores dept_scores_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.dept_scores
ADD CONSTRAINT dept_scores_pkey PRIMARY KEY (id);
--
-- Name: impact_logs impact_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.impact_logs
ADD CONSTRAINT impact_logs_pkey PRIMARY KEY (id);
--
-- Name: leave_requests leave_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.leave_requests
ADD CONSTRAINT leave_requests_pkey PRIMARY KEY (id);
--
-- Name: substitutions substitutions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.substitutions
ADD CONSTRAINT substitutions_pkey PRIMARY KEY (id);
--
-- Name: timetable timetable_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.timetable
ADD CONSTRAINT timetable_pkey PRIMARY KEY (id);
--
-- Name: users users_email_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_email_key UNIQUE (email);
--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- Name: idx_leave_faculty; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX idx_leave_faculty ON public.leave_requests USING btree (faculty_id);
--
-- Name: idx_substitute_faculty; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX idx_substitute_faculty ON public.substitutions USING btree (substitute_faculty_id);
--
-- Name: idx_users_department; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX idx_users_department ON public.users USING btree (department_id);
--
-- Name: acting_hod_assignments acting_hod_assignments_acting_hod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.acting_hod_assignments
ADD CONSTRAINT acting_hod_assignments_acting_hod_id_fkey FOREIGN KEY (acting_hod_id) REFERENCES public.users(id);
--
-- Name: acting_hod_assignments acting_hod_assignments_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.acting_hod_assignments
ADD CONSTRAINT acting_hod_assignments_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.departments(id);
--
-- Name: acting_hod_assignments acting_hod_assignments_original_hod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.acting_hod_assignments
ADD CONSTRAINT acting_hod_assignments_original_hod_id_fkey FOREIGN KEY (original_hod_id) REFERENCES public.users(id);
--
-- Name: dept_scores dept_scores_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.dept_scores
ADD CONSTRAINT dept_scores_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.departments(id);
--
-- Name: departments fk_departments_hod; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.departments
ADD CONSTRAINT fk_departments_hod FOREIGN KEY (hod_id) REFERENCES public.users(id);
--
-- Name: users fk_users_department; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT fk_users_department FOREIGN KEY (department_id) REFERENCES public.departments(id);
--
-- Name: impact_logs impact_logs_leave_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.impact_logs
ADD CONSTRAINT impact_logs_leave_id_fkey FOREIGN KEY (leave_id) REFERENCES public.leave_requests(id);
--
-- Name: leave_requests leave_requests_acting_hod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.leave_requests
ADD CONSTRAINT leave_requests_acting_hod_id_fkey FOREIGN KEY (acting_hod_id) REFERENCES public.users(id);
--
-- Name: leave_requests leave_requests_department_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.leave_requests
ADD CONSTRAINT leave_requests_department_id_fkey FOREIGN KEY (department_id) REFERENCES public.departments(id);
--
-- Name: leave_requests leave_requests_faculty_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.leave_requests
ADD CONSTRAINT leave_requests_faculty_id_fkey FOREIGN KEY (faculty_id) REFERENCES public.users(id);
--
-- Name: substitutions substitutions_leave_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.substitutions
ADD CONSTRAINT substitutions_leave_id_fkey FOREIGN KEY (leave_id) REFERENCES public.leave_requests(id);
--
-- Name: substitutions substitutions_original_faculty_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.substitutions
ADD CONSTRAINT substitutions_original_faculty_id_fkey FOREIGN KEY (original_faculty_id) REFERENCES public.users(id);
--
-- Name: substitutions substitutions_substitute_faculty_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.substitutions
ADD CONSTRAINT substitutions_substitute_faculty_id_fkey FOREIGN KEY (substitute_faculty_id) REFERENCES public.users(id);
--
-- Name: timetable timetable_faculty_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.timetable
ADD CONSTRAINT timetable_faculty_id_fkey FOREIGN KEY (faculty_id) REFERENCES public.users(id);
--
-- PostgreSQL database dump complete
--
\unrestrict e6YMwlptnUyAqqaoxJSyCqXM9ARmyRMQiR29BQeKfkVyBKvx3F3TSw6H6CPNuyJ