-
Notifications
You must be signed in to change notification settings - Fork 0
/
dump-postgres-202307311751.sql
1014 lines (718 loc) · 25 KB
/
dump-postgres-202307311751.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 cluster dump
--
-- Started on 2023-07-31 17:51:39
SET default_transaction_read_only = off;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
--
-- Roles
--
CREATE ROLE postgres;
ALTER ROLE postgres WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN REPLICATION BYPASSRLS;
--
-- User Configurations
--
--
-- Databases
--
--
-- Database "template1" dump
--
\connect template1
--
-- PostgreSQL database dump
--
-- Dumped from database version 15.3
-- Dumped by pg_dump version 15.3
-- Started on 2023-07-31 17:51:39
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;
-- Completed on 2023-07-31 17:51:40
--
-- PostgreSQL database dump complete
--
--
-- Database "postgres" dump
--
\connect postgres
--
-- PostgreSQL database dump
--
-- Dumped from database version 15.3
-- Dumped by pg_dump version 15.3
-- Started on 2023-07-31 17:51:40
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 2 (class 3079 OID 16384)
-- Name: adminpack; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS adminpack WITH SCHEMA pg_catalog;
--
-- TOC entry 3425 (class 0 OID 0)
-- Dependencies: 2
-- Name: EXTENSION adminpack; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION adminpack IS 'administrative functions for PostgreSQL';
--
-- TOC entry 235 (class 1255 OID 16398)
-- Name: create_customer(character varying, character varying, text, character varying, character varying); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.create_customer(first_name character varying, last_name character varying, delivery_address text, email character varying, phone_number character varying) RETURNS integer
LANGUAGE plpgsql
AS $$
DECLARE
customer_id INTEGER;
BEGIN
-- Вставляем данные покупателя в таблицу "Покупатели"
INSERT INTO Customers (First_Name, Last_Name, Delivery_Address, Email, Phone_Number)
VALUES (first_name, last_name, delivery_address, email, phone_number)
RETURNING ID INTO customer_id;
RETURN customer_id;
END;
$$;
ALTER FUNCTION public.create_customer(first_name character varying, last_name character varying, delivery_address text, email character varying, phone_number character varying) OWNER TO postgres;
--
-- TOC entry 236 (class 1255 OID 16399)
-- Name: create_order(integer, date, numeric, character varying, character varying, character varying); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.create_order(customer_id integer, order_date date, order_total numeric, order_status character varying, delivery_method character varying, payment_method character varying) RETURNS integer
LANGUAGE plpgsql
AS $$
DECLARE
order_id INTEGER;
BEGIN
-- Вставляем данные заказа в таблицу "Заказы"
INSERT INTO Orders (Customer_ID, Order_Date, Order_Total, Order_Status, Delivery_Method, Payment_Method)
VALUES (customer_id, order_date, order_total, order_status, delivery_method, payment_method)
RETURNING ID INTO order_id;
RETURN order_id;
END;
$$;
ALTER FUNCTION public.create_order(customer_id integer, order_date date, order_total numeric, order_status character varying, delivery_method character varying, payment_method character varying) OWNER TO postgres;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- TOC entry 230 (class 1259 OID 16513)
-- Name: categories; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.categories (
id integer NOT NULL,
name character varying(50) NOT NULL,
description text
);
ALTER TABLE public.categories OWNER TO postgres;
--
-- TOC entry 229 (class 1259 OID 16512)
-- Name: categories_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.categories_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.categories_id_seq OWNER TO postgres;
--
-- TOC entry 3426 (class 0 OID 0)
-- Dependencies: 229
-- Name: categories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.categories_id_seq OWNED BY public.categories.id;
--
-- TOC entry 215 (class 1259 OID 16406)
-- Name: customers; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.customers (
id integer NOT NULL,
first_name character varying(50) NOT NULL,
last_name character varying(50) NOT NULL,
delivery_address text NOT NULL,
email character varying(100) NOT NULL,
phone_number character varying(20) NOT NULL,
password_hash character varying
);
ALTER TABLE public.customers OWNER TO postgres;
--
-- TOC entry 216 (class 1259 OID 16411)
-- Name: customers_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.customers_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.customers_id_seq OWNER TO postgres;
--
-- TOC entry 3427 (class 0 OID 0)
-- Dependencies: 216
-- Name: customers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.customers_id_seq OWNED BY public.customers.id;
--
-- TOC entry 217 (class 1259 OID 16412)
-- Name: discounts_and_promotions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.discounts_and_promotions (
id integer NOT NULL,
name character varying(100) NOT NULL,
description text,
discount_amount numeric(5,2) NOT NULL,
start_date date NOT NULL,
end_date date NOT NULL
);
ALTER TABLE public.discounts_and_promotions OWNER TO postgres;
--
-- TOC entry 218 (class 1259 OID 16417)
-- Name: discounts_and_promotions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.discounts_and_promotions_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.discounts_and_promotions_id_seq OWNER TO postgres;
--
-- TOC entry 3428 (class 0 OID 0)
-- Dependencies: 218
-- Name: discounts_and_promotions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.discounts_and_promotions_id_seq OWNED BY public.discounts_and_promotions.id;
--
-- TOC entry 219 (class 1259 OID 16418)
-- Name: feedback; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.feedback (
id integer NOT NULL,
name character varying(100) NOT NULL,
email character varying(100) NOT NULL,
message text NOT NULL
);
ALTER TABLE public.feedback OWNER TO postgres;
--
-- TOC entry 220 (class 1259 OID 16423)
-- Name: feedback_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.feedback_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.feedback_id_seq OWNER TO postgres;
--
-- TOC entry 3429 (class 0 OID 0)
-- Dependencies: 220
-- Name: feedback_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.feedback_id_seq OWNED BY public.feedback.id;
--
-- TOC entry 221 (class 1259 OID 16424)
-- Name: orders; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.orders (
id integer NOT NULL,
order_date date NOT NULL,
order_total numeric(10,2) NOT NULL,
order_status character varying(50) NOT NULL,
delivery_method character varying(100) NOT NULL,
payment_method character varying(100) NOT NULL,
customer_id integer NOT NULL
);
ALTER TABLE public.orders OWNER TO postgres;
--
-- TOC entry 222 (class 1259 OID 16427)
-- Name: orders_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.orders_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.orders_id_seq OWNER TO postgres;
--
-- TOC entry 3430 (class 0 OID 0)
-- Dependencies: 222
-- Name: orders_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.orders_id_seq OWNED BY public.orders.id;
--
-- TOC entry 223 (class 1259 OID 16428)
-- Name: payments; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.payments (
id integer NOT NULL,
payment_date date NOT NULL,
payment_amount numeric(10,2) NOT NULL,
payment_status character varying(50) NOT NULL,
payment_system character varying(100) NOT NULL,
order_id integer NOT NULL
);
ALTER TABLE public.payments OWNER TO postgres;
--
-- TOC entry 224 (class 1259 OID 16431)
-- Name: payments_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.payments_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.payments_id_seq OWNER TO postgres;
--
-- TOC entry 3431 (class 0 OID 0)
-- Dependencies: 224
-- Name: payments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.payments_id_seq OWNED BY public.payments.id;
--
-- TOC entry 232 (class 1259 OID 16523)
-- Name: products; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.products (
id integer NOT NULL,
name character varying(100) NOT NULL,
description text NOT NULL,
price numeric(10,2) NOT NULL,
category_id integer,
brand character varying(50),
weight numeric(8,2),
color character varying(20),
material character varying(50),
stock_quantity integer,
is_available boolean DEFAULT true,
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);
ALTER TABLE public.products OWNER TO postgres;
--
-- TOC entry 231 (class 1259 OID 16522)
-- Name: products_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.products_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.products_id_seq OWNER TO postgres;
--
-- TOC entry 3432 (class 0 OID 0)
-- Dependencies: 231
-- Name: products_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.products_id_seq OWNED BY public.products.id;
--
-- TOC entry 225 (class 1259 OID 16440)
-- Name: reviews; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.reviews (
id integer NOT NULL,
rating numeric(2,1) NOT NULL,
review_text text,
review_date date NOT NULL,
customer_id integer NOT NULL,
product_id integer NOT NULL
);
ALTER TABLE public.reviews OWNER TO postgres;
--
-- TOC entry 226 (class 1259 OID 16445)
-- Name: reviews_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.reviews_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.reviews_id_seq OWNER TO postgres;
--
-- TOC entry 3433 (class 0 OID 0)
-- Dependencies: 226
-- Name: reviews_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.reviews_id_seq OWNED BY public.reviews.id;
--
-- TOC entry 227 (class 1259 OID 16446)
-- Name: shipments; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.shipments (
id integer NOT NULL,
shipment_date date NOT NULL,
delivery_cost numeric(10,2) NOT NULL,
delivery_address text NOT NULL,
shipment_status character varying(50) NOT NULL,
order_id integer NOT NULL
);
ALTER TABLE public.shipments OWNER TO postgres;
--
-- TOC entry 228 (class 1259 OID 16451)
-- Name: shipments_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.shipments_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.shipments_id_seq OWNER TO postgres;
--
-- TOC entry 3434 (class 0 OID 0)
-- Dependencies: 228
-- Name: shipments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.shipments_id_seq OWNED BY public.shipments.id;
--
-- TOC entry 234 (class 1259 OID 16540)
-- Name: shopping_cart; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.shopping_cart (
id integer NOT NULL,
user_id integer,
product_id integer,
quantity integer
);
ALTER TABLE public.shopping_cart OWNER TO postgres;
--
-- TOC entry 233 (class 1259 OID 16539)
-- Name: shopping_cart_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.shopping_cart_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.shopping_cart_id_seq OWNER TO postgres;
--
-- TOC entry 3435 (class 0 OID 0)
-- Dependencies: 233
-- Name: shopping_cart_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.shopping_cart_id_seq OWNED BY public.shopping_cart.id;
--
-- TOC entry 3228 (class 2604 OID 16516)
-- Name: categories id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.categories ALTER COLUMN id SET DEFAULT nextval('public.categories_id_seq'::regclass);
--
-- TOC entry 3221 (class 2604 OID 16453)
-- Name: customers id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.customers ALTER COLUMN id SET DEFAULT nextval('public.customers_id_seq'::regclass);
--
-- TOC entry 3222 (class 2604 OID 16454)
-- Name: discounts_and_promotions id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.discounts_and_promotions ALTER COLUMN id SET DEFAULT nextval('public.discounts_and_promotions_id_seq'::regclass);
--
-- TOC entry 3223 (class 2604 OID 16455)
-- Name: feedback id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.feedback ALTER COLUMN id SET DEFAULT nextval('public.feedback_id_seq'::regclass);
--
-- TOC entry 3224 (class 2604 OID 16456)
-- Name: orders id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.orders ALTER COLUMN id SET DEFAULT nextval('public.orders_id_seq'::regclass);
--
-- TOC entry 3225 (class 2604 OID 16457)
-- Name: payments id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.payments ALTER COLUMN id SET DEFAULT nextval('public.payments_id_seq'::regclass);
--
-- TOC entry 3229 (class 2604 OID 16526)
-- Name: products id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.products ALTER COLUMN id SET DEFAULT nextval('public.products_id_seq'::regclass);
--
-- TOC entry 3226 (class 2604 OID 16459)
-- Name: reviews id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.reviews ALTER COLUMN id SET DEFAULT nextval('public.reviews_id_seq'::regclass);
--
-- TOC entry 3227 (class 2604 OID 16460)
-- Name: shipments id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.shipments ALTER COLUMN id SET DEFAULT nextval('public.shipments_id_seq'::regclass);
--
-- TOC entry 3232 (class 2604 OID 16543)
-- Name: shopping_cart id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.shopping_cart ALTER COLUMN id SET DEFAULT nextval('public.shopping_cart_id_seq'::regclass);
--
-- TOC entry 3415 (class 0 OID 16513)
-- Dependencies: 230
-- Data for Name: categories; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.categories (id, name, description) FROM stdin;
1 Electronics Electronic devices and gadgets
2 Clothing Fashionable clothing and accessories
3 Books Various books and literary works
4 Home Decor Decorative items for home
5 Toys Toys and games for kids
6 Sports & Outdoors Sports equipment and outdoor gear
\.
--
-- TOC entry 3400 (class 0 OID 16406)
-- Dependencies: 215
-- Data for Name: customers; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.customers (id, first_name, last_name, delivery_address, email, phone_number, password_hash) FROM stdin;
5 v v Russia [email protected] 1 $2y$10$YRF99hMIEEkZmAUv.mzYHOxtXVwMh46uflGoNsr/EMAmlza4il/Bi
\.
--
-- TOC entry 3402 (class 0 OID 16412)
-- Dependencies: 217
-- Data for Name: discounts_and_promotions; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.discounts_and_promotions (id, name, description, discount_amount, start_date, end_date) FROM stdin;
\.
--
-- TOC entry 3404 (class 0 OID 16418)
-- Dependencies: 219
-- Data for Name: feedback; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.feedback (id, name, email, message) FROM stdin;
1 Виктор [email protected] Не работает регистрация
2 М м@yandex.ru test
3 v v 1
\.
--
-- TOC entry 3406 (class 0 OID 16424)
-- Dependencies: 221
-- Data for Name: orders; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.orders (id, order_date, order_total, order_status, delivery_method, payment_method, customer_id) FROM stdin;
\.
--
-- TOC entry 3408 (class 0 OID 16428)
-- Dependencies: 223
-- Data for Name: payments; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.payments (id, payment_date, payment_amount, payment_status, payment_system, order_id) FROM stdin;
\.
--
-- TOC entry 3417 (class 0 OID 16523)
-- Dependencies: 232
-- Data for Name: products; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.products (id, name, description, price, category_id, brand, weight, color, material, stock_quantity, is_available, created_at) FROM stdin;
1 Smartphone X A powerful smartphone with advanced features. 699.99 1 Brand X 0.30 Black Metal 100 t 2023-07-31 13:52:19.227934
2 Laptop Y A high-performance laptop for work and entertainment. 1099.99 1 Brand Y 2.50 Silver Aluminum 50 t 2023-07-31 13:52:19.227934
3 T-Shirt Z A comfortable and stylish t-shirt for casual wear. 29.99 2 Brand Z 0.20 Blue Cotton 200 t 2023-07-31 13:52:19.227934
4 Book A An intriguing novel that keeps you engaged. 15.99 3 Author A 0.50 N/A Paper 50 t 2023-07-31 13:52:19.227934
5 Home Decor B A decorative item to enhance your home interior. 49.99 4 Brand B 1.00 Gold Ceramic 30 t 2023-07-31 13:52:19.227934
6 Action Figure C A collectible action figure for kids. 19.99 5 Brand C 0.10 Red Plastic 100 t 2023-07-31 13:52:19.227934
7 Sports Ball D A high-quality sports ball for various sports. 24.99 6 Brand D 0.60 Various Rubber 40 t 2023-07-31 13:52:19.227934
\.
--
-- TOC entry 3410 (class 0 OID 16440)
-- Dependencies: 225
-- Data for Name: reviews; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.reviews (id, rating, review_text, review_date, customer_id, product_id) FROM stdin;
\.
--
-- TOC entry 3412 (class 0 OID 16446)
-- Dependencies: 227
-- Data for Name: shipments; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.shipments (id, shipment_date, delivery_cost, delivery_address, shipment_status, order_id) FROM stdin;
\.
--
-- TOC entry 3419 (class 0 OID 16540)
-- Dependencies: 234
-- Data for Name: shopping_cart; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.shopping_cart (id, user_id, product_id, quantity) FROM stdin;
1 5 1 1
\.
--
-- TOC entry 3436 (class 0 OID 0)
-- Dependencies: 229
-- Name: categories_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.categories_id_seq', 6, true);
--
-- TOC entry 3437 (class 0 OID 0)
-- Dependencies: 216
-- Name: customers_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.customers_id_seq', 5, true);
--
-- TOC entry 3438 (class 0 OID 0)
-- Dependencies: 218
-- Name: discounts_and_promotions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.discounts_and_promotions_id_seq', 1, false);
--
-- TOC entry 3439 (class 0 OID 0)
-- Dependencies: 220
-- Name: feedback_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.feedback_id_seq', 3, true);
--
-- TOC entry 3440 (class 0 OID 0)
-- Dependencies: 222
-- Name: orders_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.orders_id_seq', 1, false);
--
-- TOC entry 3441 (class 0 OID 0)
-- Dependencies: 224
-- Name: payments_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.payments_id_seq', 1, false);
--
-- TOC entry 3442 (class 0 OID 0)
-- Dependencies: 231
-- Name: products_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.products_id_seq', 7, true);
--
-- TOC entry 3443 (class 0 OID 0)
-- Dependencies: 226
-- Name: reviews_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.reviews_id_seq', 1, false);
--
-- TOC entry 3444 (class 0 OID 0)
-- Dependencies: 228
-- Name: shipments_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.shipments_id_seq', 1, false);
--
-- TOC entry 3445 (class 0 OID 0)
-- Dependencies: 233
-- Name: shopping_cart_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.shopping_cart_id_seq', 1, true);
--
-- TOC entry 3248 (class 2606 OID 16520)
-- Name: categories categories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.categories
ADD CONSTRAINT categories_pkey PRIMARY KEY (id);
--
-- TOC entry 3234 (class 2606 OID 16466)
-- Name: customers customers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.customers
ADD CONSTRAINT customers_pkey PRIMARY KEY (id);
--
-- TOC entry 3236 (class 2606 OID 16468)
-- Name: discounts_and_promotions discounts_and_promotions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.discounts_and_promotions
ADD CONSTRAINT discounts_and_promotions_pkey PRIMARY KEY (id);
--
-- TOC entry 3238 (class 2606 OID 16470)
-- Name: feedback feedback_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.feedback
ADD CONSTRAINT feedback_pkey PRIMARY KEY (id);
--
-- TOC entry 3240 (class 2606 OID 16472)
-- Name: orders orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.orders
ADD CONSTRAINT orders_pkey PRIMARY KEY (id);
--
-- TOC entry 3242 (class 2606 OID 16474)
-- Name: payments payments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.payments
ADD CONSTRAINT payments_pkey PRIMARY KEY (id);
--
-- TOC entry 3250 (class 2606 OID 16532)
-- Name: products products_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.products
ADD CONSTRAINT products_pkey PRIMARY KEY (id);
--
-- TOC entry 3244 (class 2606 OID 16478)
-- Name: reviews reviews_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.reviews
ADD CONSTRAINT reviews_pkey PRIMARY KEY (id);
--
-- TOC entry 3246 (class 2606 OID 16480)
-- Name: shipments shipments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.shipments
ADD CONSTRAINT shipments_pkey PRIMARY KEY (id);
--
-- TOC entry 3252 (class 2606 OID 16545)
-- Name: shopping_cart shopping_cart_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.shopping_cart
ADD CONSTRAINT shopping_cart_pkey PRIMARY KEY (id);
--
-- TOC entry 3253 (class 2606 OID 16481)
-- Name: orders orders_customer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.orders
ADD CONSTRAINT orders_customer_id_fkey FOREIGN KEY (customer_id) REFERENCES public.customers(id);
--
-- TOC entry 3254 (class 2606 OID 16486)
-- Name: payments payments_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.payments
ADD CONSTRAINT payments_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.orders(id);
--
-- TOC entry 3257 (class 2606 OID 16533)
-- Name: products products_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.products
ADD CONSTRAINT products_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.categories(id);
--
-- TOC entry 3255 (class 2606 OID 16496)
-- Name: reviews reviews_customer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.reviews
ADD CONSTRAINT reviews_customer_id_fkey FOREIGN KEY (customer_id) REFERENCES public.customers(id);
--
-- TOC entry 3256 (class 2606 OID 16506)
-- Name: shipments shipments_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.shipments
ADD CONSTRAINT shipments_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.orders(id);