· 5 years ago · Aug 14, 2020, 09:16 AM
1--
2-- PostgreSQL database dump
3--
4
5-- Dumped from database version 12.0
6-- Dumped by pg_dump version 12.0
7
8SET statement_timeout = 0;
9SET lock_timeout = 0;
10SET idle_in_transaction_session_timeout = 0;
11SET client_encoding = 'UTF8';
12SET standard_conforming_strings = on;
13SELECT pg_catalog.set_config('search_path', '', false);
14SET check_function_bodies = false;
15SET xmloption = content;
16SET client_min_messages = warning;
17SET row_security = off;
18
19DROP DATABASE IF EXISTS postgres;
20--
21-- Name: postgres; Type: DATABASE; Schema: -; Owner: postgres
22--
23
24CREATE DATABASE postgres WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'Russian_Russia.1251' LC_CTYPE = 'Russian_Russia.1251';
25
26
27ALTER DATABASE postgres OWNER TO postgres;
28
29\connect postgres
30
31SET statement_timeout = 0;
32SET lock_timeout = 0;
33SET idle_in_transaction_session_timeout = 0;
34SET client_encoding = 'UTF8';
35SET standard_conforming_strings = on;
36SELECT pg_catalog.set_config('search_path', '', false);
37SET check_function_bodies = false;
38SET xmloption = content;
39SET client_min_messages = warning;
40SET row_security = off;
41
42--
43-- Name: DATABASE postgres; Type: COMMENT; Schema: -; Owner: postgres
44--
45
46COMMENT ON DATABASE postgres IS 'default administrative connection database';
47
48
49--
50-- Name: simbirsoft_internship; Type: SCHEMA; Schema: -; Owner: postgres
51--
52
53CREATE SCHEMA simbirsoft_internship;
54
55
56ALTER SCHEMA simbirsoft_internship OWNER TO postgres;
57
58--
59-- Name: dimension; Type: TYPE; Schema: simbirsoft_internship; Owner: postgres
60--
61
62CREATE TYPE simbirsoft_internship.dimension AS ENUM (
63 'count',
64 'kg',
65 'liter'
66);
67
68
69ALTER TYPE simbirsoft_internship.dimension OWNER TO postgres;
70
71--
72-- Name: role; Type: TYPE; Schema: simbirsoft_internship; Owner: postgres
73--
74
75CREATE TYPE simbirsoft_internship.role AS ENUM (
76 'admin',
77 'customer',
78 'warehouse_keeper'
79);
80
81
82ALTER TYPE simbirsoft_internship.role OWNER TO postgres;
83
84SET default_tablespace = '';
85
86SET default_table_access_method = heap;
87
88--
89-- Name: category; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
90--
91
92CREATE TABLE simbirsoft_internship.category (
93 id bigint NOT NULL,
94 name character varying(50),
95 description character varying(250)
96);
97
98
99ALTER TABLE simbirsoft_internship.category OWNER TO postgres;
100
101--
102-- Name: category_id_seq; Type: SEQUENCE; Schema: simbirsoft_internship; Owner: postgres
103--
104
105ALTER TABLE simbirsoft_internship.category ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
106 SEQUENCE NAME simbirsoft_internship.category_id_seq
107 START WITH 1
108 INCREMENT BY 1
109 NO MINVALUE
110 NO MAXVALUE
111 CACHE 1
112);
113
114
115--
116-- Name: databasechangelog; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
117--
118
119CREATE TABLE simbirsoft_internship.databasechangelog (
120 id character varying(255) NOT NULL,
121 author character varying(255) NOT NULL,
122 filename character varying(255) NOT NULL,
123 dateexecuted timestamp without time zone NOT NULL,
124 orderexecuted integer NOT NULL,
125 exectype character varying(10) NOT NULL,
126 md5sum character varying(35),
127 description character varying(255),
128 comments character varying(255),
129 tag character varying(255),
130 liquibase character varying(20),
131 contexts character varying(255),
132 labels character varying(255),
133 deployment_id character varying(10)
134);
135
136
137ALTER TABLE simbirsoft_internship.databasechangelog OWNER TO postgres;
138
139--
140-- Name: databasechangeloglock; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
141--
142
143CREATE TABLE simbirsoft_internship.databasechangeloglock (
144 id integer NOT NULL,
145 locked boolean NOT NULL,
146 lockgranted timestamp without time zone,
147 lockedby character varying(255)
148);
149
150
151ALTER TABLE simbirsoft_internship.databasechangeloglock OWNER TO postgres;
152
153--
154-- Name: db_order; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
155--
156
157CREATE TABLE simbirsoft_internship.db_order (
158 id bigint NOT NULL,
159 is_confirmed boolean DEFAULT false,
160 ordered_at timestamp without time zone,
161 customer_id bigint NOT NULL,
162 shop_id bigint NOT NULL
163);
164
165
166ALTER TABLE simbirsoft_internship.db_order OWNER TO postgres;
167
168--
169-- Name: db_order_id_seq; Type: SEQUENCE; Schema: simbirsoft_internship; Owner: postgres
170--
171
172ALTER TABLE simbirsoft_internship.db_order ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
173 SEQUENCE NAME simbirsoft_internship.db_order_id_seq
174 START WITH 1
175 INCREMENT BY 1
176 NO MINVALUE
177 NO MAXVALUE
178 CACHE 1
179);
180
181
182--
183-- Name: db_user; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
184--
185
186CREATE TABLE simbirsoft_internship.db_user (
187 id bigint NOT NULL,
188 email character varying(50) NOT NULL,
189 username character varying(50) NOT NULL,
190 password character varying(100),
191 role character varying(30)
192);
193
194
195ALTER TABLE simbirsoft_internship.db_user OWNER TO postgres;
196
197--
198-- Name: db_user_id_seq; Type: SEQUENCE; Schema: simbirsoft_internship; Owner: postgres
199--
200
201ALTER TABLE simbirsoft_internship.db_user ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
202 SEQUENCE NAME simbirsoft_internship.db_user_id_seq
203 START WITH 1
204 INCREMENT BY 1
205 NO MINVALUE
206 NO MAXVALUE
207 CACHE 1
208);
209
210
211--
212-- Name: hibernate_sequence; Type: SEQUENCE; Schema: simbirsoft_internship; Owner: postgres
213--
214
215CREATE SEQUENCE simbirsoft_internship.hibernate_sequence
216 START WITH 1
217 INCREMENT BY 1
218 NO MINVALUE
219 NO MAXVALUE
220 CACHE 1;
221
222
223ALTER TABLE simbirsoft_internship.hibernate_sequence OWNER TO postgres;
224
225--
226-- Name: invoice; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
227--
228
229CREATE TABLE simbirsoft_internship.invoice (
230 id bigint NOT NULL,
231 arrived_at timestamp without time zone NOT NULL,
232 warehouse_id bigint NOT NULL,
233 supplier_id bigint NOT NULL,
234 is_confirmed boolean DEFAULT false
235);
236
237
238ALTER TABLE simbirsoft_internship.invoice OWNER TO postgres;
239
240--
241-- Name: invoice_id_seq; Type: SEQUENCE; Schema: simbirsoft_internship; Owner: postgres
242--
243
244ALTER TABLE simbirsoft_internship.invoice ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
245 SEQUENCE NAME simbirsoft_internship.invoice_id_seq
246 START WITH 1
247 INCREMENT BY 1
248 NO MINVALUE
249 NO MAXVALUE
250 CACHE 1
251);
252
253
254--
255-- Name: item; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
256--
257
258CREATE TABLE simbirsoft_internship.item (
259 id bigint NOT NULL,
260 item_code character varying(30) NOT NULL,
261 name character varying(50) NOT NULL,
262 description character varying(250) NOT NULL,
263 price real NOT NULL
264);
265
266
267ALTER TABLE simbirsoft_internship.item OWNER TO postgres;
268
269--
270-- Name: item_category; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
271--
272
273CREATE TABLE simbirsoft_internship.item_category (
274 item_id bigint NOT NULL,
275 category_id bigint NOT NULL
276);
277
278
279ALTER TABLE simbirsoft_internship.item_category OWNER TO postgres;
280
281--
282-- Name: item_id_seq; Type: SEQUENCE; Schema: simbirsoft_internship; Owner: postgres
283--
284
285ALTER TABLE simbirsoft_internship.item ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
286 SEQUENCE NAME simbirsoft_internship.item_id_seq
287 START WITH 1
288 INCREMENT BY 1
289 NO MINVALUE
290 NO MAXVALUE
291 CACHE 1
292);
293
294
295--
296-- Name: item_invoice; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
297--
298
299CREATE TABLE simbirsoft_internship.item_invoice (
300 item_id bigint NOT NULL,
301 invoice_id bigint NOT NULL,
302 quantity integer NOT NULL
303);
304
305
306ALTER TABLE simbirsoft_internship.item_invoice OWNER TO postgres;
307
308--
309-- Name: item_order; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
310--
311
312CREATE TABLE simbirsoft_internship.item_order (
313 item_id bigint NOT NULL,
314 order_id bigint NOT NULL,
315 quantity integer NOT NULL
316);
317
318
319ALTER TABLE simbirsoft_internship.item_order OWNER TO postgres;
320
321--
322-- Name: item_warehouse; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
323--
324
325CREATE TABLE simbirsoft_internship.item_warehouse (
326 item_id bigint NOT NULL,
327 warehouse_id bigint NOT NULL,
328 quantity integer NOT NULL
329);
330
331
332ALTER TABLE simbirsoft_internship.item_warehouse OWNER TO postgres;
333
334--
335-- Name: item_writeoff; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
336--
337
338CREATE TABLE simbirsoft_internship.item_writeoff (
339 item_id bigint NOT NULL,
340 writeoff_id bigint NOT NULL,
341 quantity integer NOT NULL
342);
343
344
345ALTER TABLE simbirsoft_internship.item_writeoff OWNER TO postgres;
346
347--
348-- Name: shop; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
349--
350
351CREATE TABLE simbirsoft_internship.shop (
352 id bigint NOT NULL,
353 name character varying(50) NOT NULL,
354 warehouse_id bigint NOT NULL
355);
356
357
358ALTER TABLE simbirsoft_internship.shop OWNER TO postgres;
359
360--
361-- Name: shop_id_seq; Type: SEQUENCE; Schema: simbirsoft_internship; Owner: postgres
362--
363
364ALTER TABLE simbirsoft_internship.shop ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
365 SEQUENCE NAME simbirsoft_internship.shop_id_seq
366 START WITH 1
367 INCREMENT BY 1
368 NO MINVALUE
369 NO MAXVALUE
370 CACHE 1
371);
372
373
374--
375-- Name: supplier; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
376--
377
378CREATE TABLE simbirsoft_internship.supplier (
379 id bigint NOT NULL,
380 name character varying(50) NOT NULL
381);
382
383
384ALTER TABLE simbirsoft_internship.supplier OWNER TO postgres;
385
386--
387-- Name: supplier_id_seq; Type: SEQUENCE; Schema: simbirsoft_internship; Owner: postgres
388--
389
390ALTER TABLE simbirsoft_internship.supplier ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
391 SEQUENCE NAME simbirsoft_internship.supplier_id_seq
392 START WITH 1
393 INCREMENT BY 1
394 NO MINVALUE
395 NO MAXVALUE
396 CACHE 1
397);
398
399
400--
401-- Name: warehouse; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
402--
403
404CREATE TABLE simbirsoft_internship.warehouse (
405 id bigint NOT NULL,
406 address character varying(100) NOT NULL
407);
408
409
410ALTER TABLE simbirsoft_internship.warehouse OWNER TO postgres;
411
412--
413-- Name: warehouse_id_seq; Type: SEQUENCE; Schema: simbirsoft_internship; Owner: postgres
414--
415
416ALTER TABLE simbirsoft_internship.warehouse ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
417 SEQUENCE NAME simbirsoft_internship.warehouse_id_seq
418 START WITH 1
419 INCREMENT BY 1
420 NO MINVALUE
421 NO MAXVALUE
422 CACHE 1
423);
424
425
426--
427-- Name: writeoff; Type: TABLE; Schema: simbirsoft_internship; Owner: postgres
428--
429
430CREATE TABLE simbirsoft_internship.writeoff (
431 id bigint NOT NULL,
432 "time" timestamp without time zone NOT NULL,
433 warehouse_id bigint NOT NULL,
434 is_confirmed boolean DEFAULT false
435);
436
437
438ALTER TABLE simbirsoft_internship.writeoff OWNER TO postgres;
439
440--
441-- Name: writeoff_id_seq; Type: SEQUENCE; Schema: simbirsoft_internship; Owner: postgres
442--
443
444ALTER TABLE simbirsoft_internship.writeoff ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
445 SEQUENCE NAME simbirsoft_internship.writeoff_id_seq
446 START WITH 1
447 INCREMENT BY 1
448 NO MINVALUE
449 NO MAXVALUE
450 CACHE 1
451);
452
453
454--
455-- Data for Name: category; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
456--
457
458INSERT INTO simbirsoft_internship.category (id, name, description) VALUES (1, 'toy', 'an object for children to play with');
459INSERT INTO simbirsoft_internship.category (id, name, description) VALUES (2, 'toy', 'an object for children to play with');
460INSERT INTO simbirsoft_internship.category (id, name, description) VALUES (3, 'supda dupa toy', 'an object for children to play with');
461INSERT INTO simbirsoft_internship.category (id, name, description) VALUES (4, 'category3', 'cat3');
462INSERT INTO simbirsoft_internship.category (id, name, description) VALUES (5, 'category4', 'cat4');
463INSERT INTO simbirsoft_internship.category (id, name, description) VALUES (6, 'category5', 'cat5');
464
465
466--
467-- Data for Name: databasechangelog; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
468--
469
470INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('changelog-1.1', 'Bulat', 'db/changelog/changelog-1.0.xml', '2020-07-29 13:36:55.361595', 1, 'EXECUTED', '8:2d24c07ddea2491e0e6b9c78772644f9', 'createTable tableName=db_user', '', NULL, '3.8.9', NULL, NULL, '6019015151');
471INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('changelog-1.2', 'Bulat', 'db/changelog/changelog-1.0.xml', '2020-07-29 13:36:55.375848', 2, 'EXECUTED', '8:d75cb9042bbb24b76631dade0f45d681', 'createTable tableName=category', '', NULL, '3.8.9', NULL, NULL, '6019015151');
472INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('changelog-1.3', 'Bulat', 'db/changelog/changelog-1.0.xml', '2020-07-29 13:36:55.390977', 3, 'EXECUTED', '8:97c0acbdb0062d470e325682c9a48f03', 'createTable tableName=item', '', NULL, '3.8.9', NULL, NULL, '6019015151');
473INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('changelog-1.4', 'Bulat', 'db/changelog/changelog-1.0.xml', '2020-07-29 13:36:55.782314', 4, 'EXECUTED', '8:1c69d231bf8d6c5d97096b47faf3e1c8', 'createTable tableName=warehouse', '', NULL, '3.8.9', NULL, NULL, '6019015151');
474INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('changelog-1.5', 'Bulat', 'db/changelog/changelog-1.0.xml', '2020-07-29 13:36:55.801957', 5, 'EXECUTED', '8:91bb3b389e866aaa1e4547e56af5af7f', 'createTable tableName=supplier', '', NULL, '3.8.9', NULL, NULL, '6019015151');
475INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('changelog-1.6', 'Bulat', 'db/changelog/changelog-1.0.xml', '2020-07-29 13:36:55.818923', 6, 'EXECUTED', '8:9024640f6ff3a1e163439ba7aeeaea0e', 'createTable tableName=stock', '', NULL, '3.8.9', NULL, NULL, '6019015151');
476INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('changelog-1.7', 'Bulat', 'db/changelog/changelog-1.0.xml', '2020-07-29 13:36:55.93512', 7, 'EXECUTED', '8:bf73a4bb4f274f159f10d4f13177a11c', 'createTable tableName=shop', '', NULL, '3.8.9', NULL, NULL, '6019015151');
477INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('changelog-1.8', 'Bulat', 'db/changelog/changelog-1.0.xml', '2020-07-29 13:36:55.946432', 8, 'EXECUTED', '8:9d3898c176c28cd1e1fe6244822583a2', 'createTable tableName=db_order', '', NULL, '3.8.9', NULL, NULL, '6019015151');
478INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('changelog-1.9', 'Bulat', 'db/changelog/changelog-1.0.xml', '2020-07-29 13:36:55.956943', 9, 'EXECUTED', '8:bcb699587a0f372d3032bf24bf5de9bf', 'createTable tableName=invoice', '', NULL, '3.8.9', NULL, NULL, '6019015151');
479INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('changelog-1.10', 'Bulat', 'db/changelog/changelog-1.0.xml', '2020-07-29 13:36:56.023492', 10, 'EXECUTED', '8:569a29cb7d5035c751982b2d2323a16f', 'createTable tableName=item_order', '', NULL, '3.8.9', NULL, NULL, '6019015151');
480INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('changelog-1.11', 'Bulat', 'db/changelog/changelog-1.0.xml', '2020-07-29 13:36:56.030313', 11, 'EXECUTED', '8:5c79e180212fe7496fbc879de9a155b2', 'createTable tableName=item_category', '', NULL, '3.8.9', NULL, NULL, '6019015151');
481INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('changelog-1.12', 'Bulat', 'db/changelog/changelog-1.0.xml', '2020-07-29 13:36:56.036409', 12, 'EXECUTED', '8:e3252307871355fc4a2bbad691790d27', 'createTable tableName=item_invoice', '', NULL, '3.8.9', NULL, NULL, '6019015151');
482INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('change-type-of-role', 'bulat', 'db/changelog/changelog-1.1.xml', '2020-07-29 13:36:56.053334', 13, 'EXECUTED', '8:6d98d8d5cdbe589c5d197f2a3995b7c4', 'modifyDataType columnName=role, tableName=db_user', '', NULL, '3.8.9', NULL, NULL, '6019015151');
483INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('invoice_confirmation', 'bulat', 'db/changelog/changelog-1.1.xml', '2020-07-29 13:36:56.322578', 14, 'EXECUTED', '8:6d2046907dc2028594176cef6e8274e5', 'addColumn tableName=invoice', '', NULL, '3.8.9', NULL, NULL, '6019015151');
484INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('item_warehouse', 'Bulat', 'db/changelog/changelog-1.1.xml', '2020-07-29 17:56:59.5575', 15, 'EXECUTED', '8:d42db86c793f4d154d939c105c156b54', 'createTable tableName=item_warehouse', '', NULL, '3.8.9', NULL, NULL, '6034618705');
485INSERT INTO simbirsoft_internship.databasechangelog (id, author, filename, dateexecuted, orderexecuted, exectype, md5sum, description, comments, tag, liquibase, contexts, labels, deployment_id) VALUES ('writeoff', 'Bulat', 'db/changelog/changelog-1.1.xml', '2020-08-01 09:33:14.716278', 16, 'EXECUTED', '8:3b62cea7b1d3a70ee39f9cd1d97dfe88', 'createTable tableName=writeoff; createTable tableName=item_writeoff', '', NULL, '3.8.9', NULL, NULL, '6263594142');
486
487
488--
489-- Data for Name: databasechangeloglock; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
490--
491
492INSERT INTO simbirsoft_internship.databasechangeloglock (id, locked, lockgranted, lockedby) VALUES (1, false, NULL, NULL);
493
494
495--
496-- Data for Name: db_order; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
497--
498
499INSERT INTO simbirsoft_internship.db_order (id, is_confirmed, ordered_at, customer_id, shop_id) VALUES (3, true, '2020-08-03 15:56:50.601873', 2, 2);
500INSERT INTO simbirsoft_internship.db_order (id, is_confirmed, ordered_at, customer_id, shop_id) VALUES (2, true, '2020-08-10 15:18:32.987821', 1, 2);
501INSERT INTO simbirsoft_internship.db_order (id, is_confirmed, ordered_at, customer_id, shop_id) VALUES (4, true, '2020-08-10 15:22:43.355647', 1, 2);
502INSERT INTO simbirsoft_internship.db_order (id, is_confirmed, ordered_at, customer_id, shop_id) VALUES (5, true, '2020-08-10 15:26:35.105838', 1, 2);
503INSERT INTO simbirsoft_internship.db_order (id, is_confirmed, ordered_at, customer_id, shop_id) VALUES (6, true, '2020-08-10 15:32:02.225102', 1, 2);
504INSERT INTO simbirsoft_internship.db_order (id, is_confirmed, ordered_at, customer_id, shop_id) VALUES (7, true, '2020-08-10 15:33:06.072667', 1, 3);
505
506
507--
508-- Data for Name: db_user; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
509--
510
511INSERT INTO simbirsoft_internship.db_user (id, email, username, password, role) VALUES (1, 'email@gmail.com', 'superuser', NULL, 'ADMIN');
512INSERT INTO simbirsoft_internship.db_user (id, email, username, password, role) VALUES (2, 'emai1l@gmail.com', 'superuser1', '$2a$10$cr2adEW5fYKp9WN5rA87weBFMNI4SqZiuNWJNpixmzKIOpFNcPRdO', 'CUSTOMER');
513
514
515--
516-- Data for Name: invoice; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
517--
518
519INSERT INTO simbirsoft_internship.invoice (id, arrived_at, warehouse_id, supplier_id, is_confirmed) VALUES (6, '2000-11-11 11:11:11', 1, 1, true);
520INSERT INTO simbirsoft_internship.invoice (id, arrived_at, warehouse_id, supplier_id, is_confirmed) VALUES (7, '2000-11-11 11:11:11', 1, 1, true);
521INSERT INTO simbirsoft_internship.invoice (id, arrived_at, warehouse_id, supplier_id, is_confirmed) VALUES (8, '2000-11-11 11:11:11', 1, 1, true);
522INSERT INTO simbirsoft_internship.invoice (id, arrived_at, warehouse_id, supplier_id, is_confirmed) VALUES (9, '2020-10-08 15:07:10', 1, 1, true);
523
524
525--
526-- Data for Name: item; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
527--
528
529INSERT INTO simbirsoft_internship.item (id, item_code, name, description, price) VALUES (1, 'BH-1123', 'robot toy', 'Its robot toy for children from 3 years old', 115.2);
530INSERT INTO simbirsoft_internship.item (id, item_code, name, description, price) VALUES (2, 'BH-111123', 'robo2t toy', 'Its robot toy for children from 3 years old', 115.221);
531INSERT INTO simbirsoft_internship.item (id, item_code, name, description, price) VALUES (3, 'BH-212', 'boxing gloves', 'boxing gloves', 115.221);
532INSERT INTO simbirsoft_internship.item (id, item_code, name, description, price) VALUES (4, 'code-1', 'item1', 'item1', 1);
533INSERT INTO simbirsoft_internship.item (id, item_code, name, description, price) VALUES (5, 'code-2', 'item2', 'item2', 2);
534INSERT INTO simbirsoft_internship.item (id, item_code, name, description, price) VALUES (6, 'code-3', 'item3', 'item3', 3);
535INSERT INTO simbirsoft_internship.item (id, item_code, name, description, price) VALUES (7, 'code-4', 'item4', 'item4', 4);
536INSERT INTO simbirsoft_internship.item (id, item_code, name, description, price) VALUES (8, 'code-5', 'item5', 'item5', 5);
537
538
539--
540-- Data for Name: item_category; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
541--
542
543INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (1, 1);
544INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (2, 1);
545INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (3, 1);
546INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (4, 1);
547INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (4, 2);
548INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (4, 3);
549INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (5, 1);
550INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (5, 2);
551INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (5, 3);
552INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (6, 5);
553INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (6, 6);
554INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (7, 3);
555INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (7, 4);
556INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (8, 2);
557INSERT INTO simbirsoft_internship.item_category (item_id, category_id) VALUES (8, 5);
558
559
560--
561-- Data for Name: item_invoice; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
562--
563
564INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (2, 6, 42);
565INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (1, 6, 1);
566INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (1, 7, 1);
567INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (2, 7, 1);
568INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (1, 8, 1);
569INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (2, 8, 1);
570INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (1, 9, 100);
571INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (2, 9, 100);
572INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (3, 9, 100);
573INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (4, 9, 100);
574INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (5, 9, 100);
575INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (6, 9, 100);
576INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (7, 9, 100);
577INSERT INTO simbirsoft_internship.item_invoice (item_id, invoice_id, quantity) VALUES (8, 9, 100);
578
579
580--
581-- Data for Name: item_order; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
582--
583
584INSERT INTO simbirsoft_internship.item_order (item_id, order_id, quantity) VALUES (2, 2, 1);
585INSERT INTO simbirsoft_internship.item_order (item_id, order_id, quantity) VALUES (2, 4, 12);
586INSERT INTO simbirsoft_internship.item_order (item_id, order_id, quantity) VALUES (5, 4, 12);
587INSERT INTO simbirsoft_internship.item_order (item_id, order_id, quantity) VALUES (3, 4, 13);
588INSERT INTO simbirsoft_internship.item_order (item_id, order_id, quantity) VALUES (4, 4, 11);
589INSERT INTO simbirsoft_internship.item_order (item_id, order_id, quantity) VALUES (2, 5, 122);
590INSERT INTO simbirsoft_internship.item_order (item_id, order_id, quantity) VALUES (3, 6, 1);
591INSERT INTO simbirsoft_internship.item_order (item_id, order_id, quantity) VALUES (4, 6, 1);
592INSERT INTO simbirsoft_internship.item_order (item_id, order_id, quantity) VALUES (4, 7, 1);
593INSERT INTO simbirsoft_internship.item_order (item_id, order_id, quantity) VALUES (6, 7, 2);
594INSERT INTO simbirsoft_internship.item_order (item_id, order_id, quantity) VALUES (7, 7, 8);
595
596
597--
598-- Data for Name: item_warehouse; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
599--
600
601INSERT INTO simbirsoft_internship.item_warehouse (item_id, warehouse_id, quantity) VALUES (1, 1, 102);
602INSERT INTO simbirsoft_internship.item_warehouse (item_id, warehouse_id, quantity) VALUES (5, 1, 100);
603INSERT INTO simbirsoft_internship.item_warehouse (item_id, warehouse_id, quantity) VALUES (8, 1, 100);
604INSERT INTO simbirsoft_internship.item_warehouse (item_id, warehouse_id, quantity) VALUES (2, 1, 62);
605INSERT INTO simbirsoft_internship.item_warehouse (item_id, warehouse_id, quantity) VALUES (3, 1, 99);
606INSERT INTO simbirsoft_internship.item_warehouse (item_id, warehouse_id, quantity) VALUES (4, 1, 98);
607INSERT INTO simbirsoft_internship.item_warehouse (item_id, warehouse_id, quantity) VALUES (6, 1, 98);
608INSERT INTO simbirsoft_internship.item_warehouse (item_id, warehouse_id, quantity) VALUES (7, 1, 92);
609
610
611--
612-- Data for Name: item_writeoff; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
613--
614
615INSERT INTO simbirsoft_internship.item_writeoff (item_id, writeoff_id, quantity) VALUES (1, 1, 1);
616INSERT INTO simbirsoft_internship.item_writeoff (item_id, writeoff_id, quantity) VALUES (2, 1, 1);
617
618
619--
620-- Data for Name: shop; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
621--
622
623INSERT INTO simbirsoft_internship.shop (id, name, warehouse_id) VALUES (2, 'Super shop', 1);
624INSERT INTO simbirsoft_internship.shop (id, name, warehouse_id) VALUES (3, 'Super shop 1', 1);
625
626
627--
628-- Data for Name: supplier; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
629--
630
631INSERT INTO simbirsoft_internship.supplier (id, name) VALUES (1, 'Super retail group');
632
633
634--
635-- Data for Name: warehouse; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
636--
637
638INSERT INTO simbirsoft_internship.warehouse (id, address) VALUES (1, 'USA, New-York, Wall Street');
639INSERT INTO simbirsoft_internship.warehouse (id, address) VALUES (2, 'Russia, Cheboksary, Zaovragom');
640
641
642--
643-- Data for Name: writeoff; Type: TABLE DATA; Schema: simbirsoft_internship; Owner: postgres
644--
645
646INSERT INTO simbirsoft_internship.writeoff (id, "time", warehouse_id, is_confirmed) VALUES (1, '2020-08-11 11:11:11', 1, true);
647
648
649--
650-- Name: category_id_seq; Type: SEQUENCE SET; Schema: simbirsoft_internship; Owner: postgres
651--
652
653SELECT pg_catalog.setval('simbirsoft_internship.category_id_seq', 6, true);
654
655
656--
657-- Name: db_order_id_seq; Type: SEQUENCE SET; Schema: simbirsoft_internship; Owner: postgres
658--
659
660SELECT pg_catalog.setval('simbirsoft_internship.db_order_id_seq', 7, true);
661
662
663--
664-- Name: db_user_id_seq; Type: SEQUENCE SET; Schema: simbirsoft_internship; Owner: postgres
665--
666
667SELECT pg_catalog.setval('simbirsoft_internship.db_user_id_seq', 2, true);
668
669
670--
671-- Name: hibernate_sequence; Type: SEQUENCE SET; Schema: simbirsoft_internship; Owner: postgres
672--
673
674SELECT pg_catalog.setval('simbirsoft_internship.hibernate_sequence', 3, true);
675
676
677--
678-- Name: invoice_id_seq; Type: SEQUENCE SET; Schema: simbirsoft_internship; Owner: postgres
679--
680
681SELECT pg_catalog.setval('simbirsoft_internship.invoice_id_seq', 9, true);
682
683
684--
685-- Name: item_id_seq; Type: SEQUENCE SET; Schema: simbirsoft_internship; Owner: postgres
686--
687
688SELECT pg_catalog.setval('simbirsoft_internship.item_id_seq', 8, true);
689
690
691--
692-- Name: shop_id_seq; Type: SEQUENCE SET; Schema: simbirsoft_internship; Owner: postgres
693--
694
695SELECT pg_catalog.setval('simbirsoft_internship.shop_id_seq', 1, false);
696
697
698--
699-- Name: supplier_id_seq; Type: SEQUENCE SET; Schema: simbirsoft_internship; Owner: postgres
700--
701
702SELECT pg_catalog.setval('simbirsoft_internship.supplier_id_seq', 1, true);
703
704
705--
706-- Name: warehouse_id_seq; Type: SEQUENCE SET; Schema: simbirsoft_internship; Owner: postgres
707--
708
709SELECT pg_catalog.setval('simbirsoft_internship.warehouse_id_seq', 2, true);
710
711
712--
713-- Name: writeoff_id_seq; Type: SEQUENCE SET; Schema: simbirsoft_internship; Owner: postgres
714--
715
716SELECT pg_catalog.setval('simbirsoft_internship.writeoff_id_seq', 1, true);
717
718
719--
720-- Name: category category_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
721--
722
723ALTER TABLE ONLY simbirsoft_internship.category
724 ADD CONSTRAINT category_pkey PRIMARY KEY (id);
725
726
727--
728-- Name: databasechangeloglock databasechangeloglock_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
729--
730
731ALTER TABLE ONLY simbirsoft_internship.databasechangeloglock
732 ADD CONSTRAINT databasechangeloglock_pkey PRIMARY KEY (id);
733
734
735--
736-- Name: db_order db_order_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
737--
738
739ALTER TABLE ONLY simbirsoft_internship.db_order
740 ADD CONSTRAINT db_order_pkey PRIMARY KEY (id);
741
742
743--
744-- Name: db_user db_user_email_key; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
745--
746
747ALTER TABLE ONLY simbirsoft_internship.db_user
748 ADD CONSTRAINT db_user_email_key UNIQUE (email);
749
750
751--
752-- Name: db_user db_user_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
753--
754
755ALTER TABLE ONLY simbirsoft_internship.db_user
756 ADD CONSTRAINT db_user_pkey PRIMARY KEY (id);
757
758
759--
760-- Name: db_user db_user_username_key; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
761--
762
763ALTER TABLE ONLY simbirsoft_internship.db_user
764 ADD CONSTRAINT db_user_username_key UNIQUE (username);
765
766
767--
768-- Name: invoice invoice_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
769--
770
771ALTER TABLE ONLY simbirsoft_internship.invoice
772 ADD CONSTRAINT invoice_pkey PRIMARY KEY (id);
773
774
775--
776-- Name: item_category item_category_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
777--
778
779ALTER TABLE ONLY simbirsoft_internship.item_category
780 ADD CONSTRAINT item_category_pkey PRIMARY KEY (item_id, category_id);
781
782
783--
784-- Name: item_invoice item_invoice_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
785--
786
787ALTER TABLE ONLY simbirsoft_internship.item_invoice
788 ADD CONSTRAINT item_invoice_pkey PRIMARY KEY (item_id, invoice_id);
789
790
791--
792-- Name: item item_item_code_key; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
793--
794
795ALTER TABLE ONLY simbirsoft_internship.item
796 ADD CONSTRAINT item_item_code_key UNIQUE (item_code);
797
798
799--
800-- Name: item_order item_order_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
801--
802
803ALTER TABLE ONLY simbirsoft_internship.item_order
804 ADD CONSTRAINT item_order_pkey PRIMARY KEY (item_id, order_id);
805
806
807--
808-- Name: item item_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
809--
810
811ALTER TABLE ONLY simbirsoft_internship.item
812 ADD CONSTRAINT item_pkey PRIMARY KEY (id);
813
814
815--
816-- Name: item_warehouse item_warehouse_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
817--
818
819ALTER TABLE ONLY simbirsoft_internship.item_warehouse
820 ADD CONSTRAINT item_warehouse_pkey PRIMARY KEY (item_id, warehouse_id);
821
822
823--
824-- Name: item_writeoff item_writeoff_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
825--
826
827ALTER TABLE ONLY simbirsoft_internship.item_writeoff
828 ADD CONSTRAINT item_writeoff_pkey PRIMARY KEY (item_id, writeoff_id);
829
830
831--
832-- Name: shop shop_name_key; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
833--
834
835ALTER TABLE ONLY simbirsoft_internship.shop
836 ADD CONSTRAINT shop_name_key UNIQUE (name);
837
838
839--
840-- Name: shop shop_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
841--
842
843ALTER TABLE ONLY simbirsoft_internship.shop
844 ADD CONSTRAINT shop_pkey PRIMARY KEY (id);
845
846
847--
848-- Name: supplier supplier_name_key; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
849--
850
851ALTER TABLE ONLY simbirsoft_internship.supplier
852 ADD CONSTRAINT supplier_name_key UNIQUE (name);
853
854
855--
856-- Name: supplier supplier_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
857--
858
859ALTER TABLE ONLY simbirsoft_internship.supplier
860 ADD CONSTRAINT supplier_pkey PRIMARY KEY (id);
861
862
863--
864-- Name: warehouse warehouse_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
865--
866
867ALTER TABLE ONLY simbirsoft_internship.warehouse
868 ADD CONSTRAINT warehouse_pkey PRIMARY KEY (id);
869
870
871--
872-- Name: writeoff writeoff_pkey; Type: CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
873--
874
875ALTER TABLE ONLY simbirsoft_internship.writeoff
876 ADD CONSTRAINT writeoff_pkey PRIMARY KEY (id);
877
878
879--
880-- Name: item_category fk_category_item; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
881--
882
883ALTER TABLE ONLY simbirsoft_internship.item_category
884 ADD CONSTRAINT fk_category_item FOREIGN KEY (category_id) REFERENCES simbirsoft_internship.category(id);
885
886
887--
888-- Name: item_invoice fk_invoice_item; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
889--
890
891ALTER TABLE ONLY simbirsoft_internship.item_invoice
892 ADD CONSTRAINT fk_invoice_item FOREIGN KEY (invoice_id) REFERENCES simbirsoft_internship.invoice(id);
893
894
895--
896-- Name: invoice fk_invoice_supplier; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
897--
898
899ALTER TABLE ONLY simbirsoft_internship.invoice
900 ADD CONSTRAINT fk_invoice_supplier FOREIGN KEY (supplier_id) REFERENCES simbirsoft_internship.supplier(id);
901
902
903--
904-- Name: invoice fk_invoice_warehouse; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
905--
906
907ALTER TABLE ONLY simbirsoft_internship.invoice
908 ADD CONSTRAINT fk_invoice_warehouse FOREIGN KEY (warehouse_id) REFERENCES simbirsoft_internship.warehouse(id);
909
910
911--
912-- Name: writeoff fk_invoice_warehouse; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
913--
914
915ALTER TABLE ONLY simbirsoft_internship.writeoff
916 ADD CONSTRAINT fk_invoice_warehouse FOREIGN KEY (warehouse_id) REFERENCES simbirsoft_internship.warehouse(id);
917
918
919--
920-- Name: item_category fk_item_category; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
921--
922
923ALTER TABLE ONLY simbirsoft_internship.item_category
924 ADD CONSTRAINT fk_item_category FOREIGN KEY (item_id) REFERENCES simbirsoft_internship.item(id);
925
926
927--
928-- Name: item_invoice fk_item_invoice; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
929--
930
931ALTER TABLE ONLY simbirsoft_internship.item_invoice
932 ADD CONSTRAINT fk_item_invoice FOREIGN KEY (item_id) REFERENCES simbirsoft_internship.item(id);
933
934
935--
936-- Name: item_order fk_item_order; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
937--
938
939ALTER TABLE ONLY simbirsoft_internship.item_order
940 ADD CONSTRAINT fk_item_order FOREIGN KEY (item_id) REFERENCES simbirsoft_internship.item(id);
941
942
943--
944-- Name: item_warehouse fk_item_warehouse; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
945--
946
947ALTER TABLE ONLY simbirsoft_internship.item_warehouse
948 ADD CONSTRAINT fk_item_warehouse FOREIGN KEY (item_id) REFERENCES simbirsoft_internship.item(id);
949
950
951--
952-- Name: item_writeoff fk_item_writeoff; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
953--
954
955ALTER TABLE ONLY simbirsoft_internship.item_writeoff
956 ADD CONSTRAINT fk_item_writeoff FOREIGN KEY (item_id) REFERENCES simbirsoft_internship.item(id);
957
958
959--
960-- Name: db_order fk_order_customer; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
961--
962
963ALTER TABLE ONLY simbirsoft_internship.db_order
964 ADD CONSTRAINT fk_order_customer FOREIGN KEY (customer_id) REFERENCES simbirsoft_internship.db_user(id);
965
966
967--
968-- Name: item_order fk_order_item; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
969--
970
971ALTER TABLE ONLY simbirsoft_internship.item_order
972 ADD CONSTRAINT fk_order_item FOREIGN KEY (order_id) REFERENCES simbirsoft_internship.db_order(id);
973
974
975--
976-- Name: db_order fk_order_shop; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
977--
978
979ALTER TABLE ONLY simbirsoft_internship.db_order
980 ADD CONSTRAINT fk_order_shop FOREIGN KEY (shop_id) REFERENCES simbirsoft_internship.shop(id);
981
982
983--
984-- Name: shop fk_shop_warehouse; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
985--
986
987ALTER TABLE ONLY simbirsoft_internship.shop
988 ADD CONSTRAINT fk_shop_warehouse FOREIGN KEY (warehouse_id) REFERENCES simbirsoft_internship.warehouse(id);
989
990
991--
992-- Name: item_warehouse fk_warehouse_item; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
993--
994
995ALTER TABLE ONLY simbirsoft_internship.item_warehouse
996 ADD CONSTRAINT fk_warehouse_item FOREIGN KEY (warehouse_id) REFERENCES simbirsoft_internship.warehouse(id);
997
998
999--
1000-- Name: item_writeoff fk_writeoff_item; Type: FK CONSTRAINT; Schema: simbirsoft_internship; Owner: postgres
1001--
1002
1003ALTER TABLE ONLY simbirsoft_internship.item_writeoff
1004 ADD CONSTRAINT fk_writeoff_item FOREIGN KEY (writeoff_id) REFERENCES simbirsoft_internship.writeoff(id);
1005
1006
1007--
1008-- PostgreSQL database dump complete
1009--
1010