-
Notifications
You must be signed in to change notification settings - Fork 0
/
DB-Schema.sql
1179 lines (837 loc) · 29.8 KB
/
DB-Schema.sql
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
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
-- Dumped from database version 14.13
-- Dumped by pg_dump version 14.13
-- Started on 2024-10-11 15:04:35 UTC
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;
DROP DATABASE IF EXISTS appsmith;
--
-- TOC entry 3527 (class 1262 OID 16384)
-- Name: appsmith; Type: DATABASE; Schema: -; Owner: postgres
--
CREATE DATABASE appsmith WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'en_US.utf8';
ALTER DATABASE appsmith OWNER TO postgres;
\connect appsmith
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;
--
-- TOC entry 3 (class 2615 OID 2200)
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA public;
ALTER SCHEMA public OWNER TO postgres;
--
-- TOC entry 3528 (class 0 OID 0)
-- Dependencies: 3
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON SCHEMA public IS 'standard public schema';
--
-- TOC entry 240 (class 1255 OID 24692)
-- Name: save_notes_history(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.save_notes_history() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
INSERT INTO notes_history (note_id, component_id, note_text, updated_at)
VALUES (OLD.note_id, OLD.component_id, OLD.note_text, NOW());
RETURN NEW;
END;
$$;
ALTER FUNCTION public.save_notes_history() OWNER TO postgres;
--
-- TOC entry 241 (class 1255 OID 24690)
-- Name: save_video_history(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.save_video_history() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
INSERT INTO video_history (video_id, title, description, script, status, updated_at)
VALUES (OLD.video_id, OLD.title, OLD.description, OLD.script, OLD.status, NOW());
RETURN NEW;
END;
$$;
ALTER FUNCTION public.save_video_history() OWNER TO postgres;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- TOC entry 209 (class 1259 OID 16385)
-- Name: boxes; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.boxes (
box_id integer NOT NULL,
box_label character varying(255) NOT NULL,
box_code character varying,
box_qr_filename text,
box_qr_content bytea,
box_qr_file_type text
);
ALTER TABLE public.boxes OWNER TO postgres;
--
-- TOC entry 210 (class 1259 OID 16390)
-- Name: boxes_box_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.boxes_box_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.boxes_box_id_seq OWNER TO postgres;
--
-- TOC entry 3529 (class 0 OID 0)
-- Dependencies: 210
-- Name: boxes_box_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.boxes_box_id_seq OWNED BY public.boxes.box_id;
--
-- TOC entry 211 (class 1259 OID 16391)
-- Name: categories; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.categories (
category_id integer NOT NULL,
category_name character varying(255) NOT NULL
);
ALTER TABLE public.categories OWNER TO postgres;
--
-- TOC entry 212 (class 1259 OID 16394)
-- Name: categories_category_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.categories_category_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.categories_category_id_seq OWNER TO postgres;
--
-- TOC entry 3530 (class 0 OID 0)
-- Dependencies: 212
-- Name: categories_category_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.categories_category_id_seq OWNED BY public.categories.category_id;
--
-- TOC entry 237 (class 1259 OID 24703)
-- Name: component_files; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.component_files (
file_id integer NOT NULL,
component_id integer NOT NULL,
minio_file_name character varying(255) NOT NULL,
minio_bucket character varying(255) NOT NULL,
minio_file_type character varying(50),
upload_date timestamp without time zone DEFAULT now(),
description text
);
ALTER TABLE public.component_files OWNER TO postgres;
--
-- TOC entry 236 (class 1259 OID 24702)
-- Name: component_files_file_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.component_files_file_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.component_files_file_id_seq OWNER TO postgres;
--
-- TOC entry 3531 (class 0 OID 0)
-- Dependencies: 236
-- Name: component_files_file_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.component_files_file_id_seq OWNED BY public.component_files.file_id;
--
-- TOC entry 213 (class 1259 OID 16395)
-- Name: components; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.components (
component_id integer NOT NULL,
name character varying(255) NOT NULL,
imaeg_name text,
category_id integer,
box_id integer,
description text,
date_added date DEFAULT CURRENT_DATE,
image_content bytea,
image_type text
);
ALTER TABLE public.components OWNER TO postgres;
--
-- TOC entry 214 (class 1259 OID 16401)
-- Name: components_component_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.components_component_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.components_component_id_seq OWNER TO postgres;
--
-- TOC entry 3532 (class 0 OID 0)
-- Dependencies: 214
-- Name: components_component_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.components_component_id_seq OWNED BY public.components.component_id;
--
-- TOC entry 225 (class 1259 OID 16543)
-- Name: invoices; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.invoices (
invoice_id integer NOT NULL,
order_id integer,
invoice_date date NOT NULL,
minio_file_name text,
total_amount numeric(10,2),
created_at timestamp without time zone DEFAULT now(),
minio_bucket text,
minio_file_type text,
description text
);
ALTER TABLE public.invoices OWNER TO postgres;
--
-- TOC entry 224 (class 1259 OID 16542)
-- Name: invoices_invoice_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.invoices_invoice_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.invoices_invoice_id_seq OWNER TO postgres;
--
-- TOC entry 3533 (class 0 OID 0)
-- Dependencies: 224
-- Name: invoices_invoice_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.invoices_invoice_id_seq OWNED BY public.invoices.invoice_id;
--
-- TOC entry 231 (class 1259 OID 24640)
-- Name: notes; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.notes (
note_id integer NOT NULL,
component_id integer,
note_text text,
created_at timestamp without time zone DEFAULT now(),
updated_at timestamp without time zone DEFAULT now()
);
ALTER TABLE public.notes OWNER TO postgres;
--
-- TOC entry 235 (class 1259 OID 24671)
-- Name: notes_history; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.notes_history (
history_id integer NOT NULL,
note_id integer NOT NULL,
component_id integer,
note_text text,
updated_at timestamp without time zone DEFAULT now()
);
ALTER TABLE public.notes_history OWNER TO postgres;
--
-- TOC entry 234 (class 1259 OID 24670)
-- Name: notes_history_history_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.notes_history_history_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.notes_history_history_id_seq OWNER TO postgres;
--
-- TOC entry 3534 (class 0 OID 0)
-- Dependencies: 234
-- Name: notes_history_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.notes_history_history_id_seq OWNED BY public.notes_history.history_id;
--
-- TOC entry 230 (class 1259 OID 24639)
-- Name: notes_note_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.notes_note_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.notes_note_id_seq OWNER TO postgres;
--
-- TOC entry 3535 (class 0 OID 0)
-- Dependencies: 230
-- Name: notes_note_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.notes_note_id_seq OWNED BY public.notes.note_id;
--
-- TOC entry 215 (class 1259 OID 16402)
-- Name: order_parts; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.order_parts (
order_part_id integer NOT NULL,
order_id integer,
component_id integer,
quantity_ordered integer NOT NULL,
unit_cost numeric(10,2) NOT NULL,
url character varying(8000)
);
ALTER TABLE public.order_parts OWNER TO postgres;
--
-- TOC entry 216 (class 1259 OID 16405)
-- Name: order_parts_order_part_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.order_parts_order_part_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.order_parts_order_part_id_seq OWNER TO postgres;
--
-- TOC entry 3536 (class 0 OID 0)
-- Dependencies: 216
-- Name: order_parts_order_part_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.order_parts_order_part_id_seq OWNED BY public.order_parts.order_part_id;
--
-- TOC entry 217 (class 1259 OID 16406)
-- Name: orders; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.orders (
order_id integer NOT NULL,
vendor_id integer,
order_date date NOT NULL,
total_cost numeric(10,2) NOT NULL,
delivery_date date,
status character varying(50) DEFAULT 'Pending'::character varying
);
ALTER TABLE public.orders OWNER TO postgres;
--
-- TOC entry 218 (class 1259 OID 16410)
-- Name: orders_order_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.orders_order_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.orders_order_id_seq OWNER TO postgres;
--
-- TOC entry 3537 (class 0 OID 0)
-- Dependencies: 218
-- Name: orders_order_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.orders_order_id_seq OWNED BY public.orders.order_id;
--
-- TOC entry 219 (class 1259 OID 16411)
-- Name: project_components; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.project_components (
project_id integer NOT NULL,
component_id integer NOT NULL,
quantity_used integer NOT NULL,
date date
);
ALTER TABLE public.project_components OWNER TO postgres;
--
-- TOC entry 239 (class 1259 OID 24739)
-- Name: project_files; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.project_files (
file_id integer NOT NULL,
project_id integer NOT NULL,
minio_bucket character varying(255) NOT NULL,
minio_file_name character varying(255) NOT NULL,
minio_file_type character varying(100) NOT NULL,
uploaded_at timestamp without time zone DEFAULT now(),
description text
);
ALTER TABLE public.project_files OWNER TO postgres;
--
-- TOC entry 238 (class 1259 OID 24738)
-- Name: project_files_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.project_files_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.project_files_id_seq OWNER TO postgres;
--
-- TOC entry 3538 (class 0 OID 0)
-- Dependencies: 238
-- Name: project_files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.project_files_id_seq OWNED BY public.project_files.file_id;
--
-- TOC entry 220 (class 1259 OID 16414)
-- Name: projects; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.projects (
project_id integer NOT NULL,
project_name character varying(255) NOT NULL,
start_date date,
end_date date,
status character varying(50),
description text,
is_yt_project boolean DEFAULT false,
git_repository text
);
ALTER TABLE public.projects OWNER TO postgres;
--
-- TOC entry 221 (class 1259 OID 16417)
-- Name: projects_project_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.projects_project_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.projects_project_id_seq OWNER TO postgres;
--
-- TOC entry 3539 (class 0 OID 0)
-- Dependencies: 221
-- Name: projects_project_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.projects_project_id_seq OWNED BY public.projects.project_id;
--
-- TOC entry 222 (class 1259 OID 16418)
-- Name: vendors; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.vendors (
vendor_id integer NOT NULL,
vendor_name character varying(255) NOT NULL,
website character varying(255),
contact_email character varying(255),
phone_number character varying(50),
vendor_icon_name text,
vendor_icon_type text,
vendor_icon_content bytea
);
ALTER TABLE public.vendors OWNER TO postgres;
--
-- TOC entry 223 (class 1259 OID 16423)
-- Name: vendors_vendor_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.vendors_vendor_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.vendors_vendor_id_seq OWNER TO postgres;
--
-- TOC entry 3540 (class 0 OID 0)
-- Dependencies: 223
-- Name: vendors_vendor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.vendors_vendor_id_seq OWNED BY public.vendors.vendor_id;
--
-- TOC entry 227 (class 1259 OID 24590)
-- Name: video; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.video (
video_id integer NOT NULL,
title character varying(255) NOT NULL,
description text,
script text,
status character varying(50),
publish_date timestamp without time zone,
projects_id integer,
youtube_video_id text
);
ALTER TABLE public.video OWNER TO postgres;
--
-- TOC entry 233 (class 1259 OID 24656)
-- Name: video_history; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.video_history (
history_id integer NOT NULL,
video_id integer NOT NULL,
title character varying(255),
description text,
script text,
status character varying(50),
publish_date timestamp without time zone,
youtube_url character varying(255),
is_project boolean,
updated_at timestamp without time zone DEFAULT now()
);
ALTER TABLE public.video_history OWNER TO postgres;
--
-- TOC entry 232 (class 1259 OID 24655)
-- Name: video_history_history_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.video_history_history_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.video_history_history_id_seq OWNER TO postgres;
--
-- TOC entry 3541 (class 0 OID 0)
-- Dependencies: 232
-- Name: video_history_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.video_history_history_id_seq OWNED BY public.video_history.history_id;
--
-- TOC entry 226 (class 1259 OID 24589)
-- Name: video_video_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.video_video_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.video_video_id_seq OWNER TO postgres;
--
-- TOC entry 3542 (class 0 OID 0)
-- Dependencies: 226
-- Name: video_video_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.video_video_id_seq OWNED BY public.video.video_id;
--
-- TOC entry 229 (class 1259 OID 24605)
-- Name: videostatus; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.videostatus (
status_id integer NOT NULL,
video_id integer,
status character varying(50) NOT NULL,
date_changed timestamp without time zone DEFAULT now()
);
ALTER TABLE public.videostatus OWNER TO postgres;
--
-- TOC entry 228 (class 1259 OID 24604)
-- Name: videostatus_status_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.videostatus_status_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.videostatus_status_id_seq OWNER TO postgres;
--
-- TOC entry 3543 (class 0 OID 0)
-- Dependencies: 228
-- Name: videostatus_status_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.videostatus_status_id_seq OWNED BY public.videostatus.status_id;
--
-- TOC entry 3309 (class 2604 OID 16424)
-- Name: boxes box_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.boxes ALTER COLUMN box_id SET DEFAULT nextval('public.boxes_box_id_seq'::regclass);
--
-- TOC entry 3310 (class 2604 OID 16425)
-- Name: categories category_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.categories ALTER COLUMN category_id SET DEFAULT nextval('public.categories_category_id_seq'::regclass);
--
-- TOC entry 3331 (class 2604 OID 24706)
-- Name: component_files file_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.component_files ALTER COLUMN file_id SET DEFAULT nextval('public.component_files_file_id_seq'::regclass);
--
-- TOC entry 3312 (class 2604 OID 16426)
-- Name: components component_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.components ALTER COLUMN component_id SET DEFAULT nextval('public.components_component_id_seq'::regclass);
--
-- TOC entry 3319 (class 2604 OID 16546)
-- Name: invoices invoice_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.invoices ALTER COLUMN invoice_id SET DEFAULT nextval('public.invoices_invoice_id_seq'::regclass);
--
-- TOC entry 3324 (class 2604 OID 24643)
-- Name: notes note_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.notes ALTER COLUMN note_id SET DEFAULT nextval('public.notes_note_id_seq'::regclass);
--
-- TOC entry 3329 (class 2604 OID 24674)
-- Name: notes_history history_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.notes_history ALTER COLUMN history_id SET DEFAULT nextval('public.notes_history_history_id_seq'::regclass);
--
-- TOC entry 3313 (class 2604 OID 16427)
-- Name: order_parts order_part_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.order_parts ALTER COLUMN order_part_id SET DEFAULT nextval('public.order_parts_order_part_id_seq'::regclass);
--
-- TOC entry 3315 (class 2604 OID 16428)
-- Name: orders order_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.orders ALTER COLUMN order_id SET DEFAULT nextval('public.orders_order_id_seq'::regclass);
--
-- TOC entry 3333 (class 2604 OID 24742)
-- Name: project_files file_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.project_files ALTER COLUMN file_id SET DEFAULT nextval('public.project_files_id_seq'::regclass);
--
-- TOC entry 3316 (class 2604 OID 16429)
-- Name: projects project_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.projects ALTER COLUMN project_id SET DEFAULT nextval('public.projects_project_id_seq'::regclass);
--
-- TOC entry 3318 (class 2604 OID 16430)
-- Name: vendors vendor_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.vendors ALTER COLUMN vendor_id SET DEFAULT nextval('public.vendors_vendor_id_seq'::regclass);
--
-- TOC entry 3321 (class 2604 OID 24593)
-- Name: video video_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.video ALTER COLUMN video_id SET DEFAULT nextval('public.video_video_id_seq'::regclass);
--
-- TOC entry 3327 (class 2604 OID 24659)
-- Name: video_history history_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.video_history ALTER COLUMN history_id SET DEFAULT nextval('public.video_history_history_id_seq'::regclass);
--
-- TOC entry 3322 (class 2604 OID 24608)
-- Name: videostatus status_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.videostatus ALTER COLUMN status_id SET DEFAULT nextval('public.videostatus_status_id_seq'::regclass);
--
-- TOC entry 3336 (class 2606 OID 16432)
-- Name: boxes boxes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.boxes
ADD CONSTRAINT boxes_pkey PRIMARY KEY (box_id);
--
-- TOC entry 3338 (class 2606 OID 16434)
-- Name: categories categories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.categories
ADD CONSTRAINT categories_pkey PRIMARY KEY (category_id);
--
-- TOC entry 3362 (class 2606 OID 24711)
-- Name: component_files component_files_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.component_files
ADD CONSTRAINT component_files_pkey PRIMARY KEY (file_id);
--
-- TOC entry 3340 (class 2606 OID 16436)
-- Name: components components_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.components
ADD CONSTRAINT components_pkey PRIMARY KEY (component_id);
--
-- TOC entry 3350 (class 2606 OID 16551)
-- Name: invoices invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.invoices
ADD CONSTRAINT invoices_pkey PRIMARY KEY (invoice_id);
--
-- TOC entry 3360 (class 2606 OID 24679)
-- Name: notes_history notes_history_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.notes_history
ADD CONSTRAINT notes_history_pkey PRIMARY KEY (history_id);
--
-- TOC entry 3356 (class 2606 OID 24649)
-- Name: notes notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.notes
ADD CONSTRAINT notes_pkey PRIMARY KEY (note_id);
--
-- TOC entry 3342 (class 2606 OID 16438)
-- Name: order_parts order_parts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.order_parts
ADD CONSTRAINT order_parts_pkey PRIMARY KEY (order_part_id);
--
-- TOC entry 3344 (class 2606 OID 16440)
-- Name: orders orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.orders
ADD CONSTRAINT orders_pkey PRIMARY KEY (order_id);
--
-- TOC entry 3364 (class 2606 OID 24747)
-- Name: project_files project_files_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.project_files
ADD CONSTRAINT project_files_pkey PRIMARY KEY (file_id);
--
-- TOC entry 3346 (class 2606 OID 16444)
-- Name: projects projects_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.projects
ADD CONSTRAINT projects_pkey PRIMARY KEY (project_id);
--
-- TOC entry 3348 (class 2606 OID 16446)
-- Name: vendors vendors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.vendors
ADD CONSTRAINT vendors_pkey PRIMARY KEY (vendor_id);
--
-- TOC entry 3358 (class 2606 OID 24664)
-- Name: video_history video_history_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.video_history
ADD CONSTRAINT video_history_pkey PRIMARY KEY (history_id);
--
-- TOC entry 3352 (class 2606 OID 24598)
-- Name: video video_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--