Repository navigation
Expand file tree
/
Copy pathATS-BD-PostgreSQL.sql
More file actions
799 lines (526 loc) · 18.2 KB
/
Copy pathATS-BD-PostgreSQL.sql
File metadata and controls
799 lines (526 loc) · 18.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_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;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: cliente; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.cliente (
id integer NOT NULL,
cpf character varying(13),
endereco character varying(100),
nome character varying(50),
telefone character varying(12)
);
ALTER TABLE public.cliente OWNER TO postgres;
--
-- Name: cliente_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.cliente_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.cliente_id_seq OWNER TO postgres;
--
-- Name: cliente_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.cliente_id_seq OWNED BY public.cliente.id;
--
-- Name: dispositivo; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.dispositivo (
id integer NOT NULL,
descricao character varying(150),
num_serie integer,
cliente_id integer,
marca_id integer,
modelo_id integer
);
ALTER TABLE public.dispositivo OWNER TO postgres;
--
-- Name: dispositivo_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.dispositivo_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.dispositivo_id_seq OWNER TO postgres;
--
-- Name: dispositivo_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.dispositivo_id_seq OWNED BY public.dispositivo.id;
--
-- Name: feed_back; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.feed_back (
id integer NOT NULL,
comentario character varying(100),
satisfacao integer,
ordemdeservico_id integer
);
ALTER TABLE public.feed_back OWNER TO postgres;
--
-- Name: feed_back_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.feed_back_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.feed_back_id_seq OWNER TO postgres;
--
-- Name: feed_back_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.feed_back_id_seq OWNED BY public.feed_back.id;
--
-- Name: garantia; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.garantia (
id integer NOT NULL,
data_entrada character varying(8),
data_saida character varying(8),
motivo character varying(150),
ordemdeservico_id integer,
servico_id integer,
statusgarantia_id integer
);
ALTER TABLE public.garantia OWNER TO postgres;
--
-- Name: garantia_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.garantia_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.garantia_id_seq OWNER TO postgres;
--
-- Name: garantia_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.garantia_id_seq OWNED BY public.garantia.id;
--
-- Name: marca; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.marca (
id integer NOT NULL,
nome character varying(20)
);
ALTER TABLE public.marca OWNER TO postgres;
--
-- Name: marca_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.marca_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.marca_id_seq OWNER TO postgres;
--
-- Name: marca_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.marca_id_seq OWNED BY public.marca.id;
--
-- Name: modelo; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.modelo (
id integer NOT NULL,
nome character varying(20),
marca_id integer
);
ALTER TABLE public.modelo OWNER TO postgres;
--
-- Name: modelo_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.modelo_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.modelo_id_seq OWNER TO postgres;
--
-- Name: modelo_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.modelo_id_seq OWNED BY public.modelo.id;
--
-- Name: orcamento; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.orcamento (
id integer NOT NULL,
descricao character varying(150),
valor_total real,
cliente_id integer,
dispositivo_id integer,
tecnico_id integer
);
ALTER TABLE public.orcamento OWNER TO postgres;
--
-- Name: orcamento_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.orcamento_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.orcamento_id_seq OWNER TO postgres;
--
-- Name: orcamento_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.orcamento_id_seq OWNED BY public.orcamento.id;
--
-- Name: ordem_de_servico; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.ordem_de_servico (
id integer NOT NULL,
data_entrada character varying(8),
data_saida character varying(8),
descricao_problema character varying(50),
valor_total real,
cliente_id integer,
dispositivo_id integer,
statusordemdeservico_id integer,
tecnico_id integer
);
ALTER TABLE public.ordem_de_servico OWNER TO postgres;
--
-- Name: ordem_de_servico_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.ordem_de_servico_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.ordem_de_servico_id_seq OWNER TO postgres;
--
-- Name: ordem_de_servico_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.ordem_de_servico_id_seq OWNED BY public.ordem_de_servico.id;
--
-- Name: ordem_servico_item; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.ordem_servico_item (
valor real,
ordemdeservico_id integer NOT NULL,
servicos_id integer NOT NULL
);
ALTER TABLE public.ordem_servico_item OWNER TO postgres;
--
-- Name: servicos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.servicos (
id integer NOT NULL,
descricao character varying(100)
);
ALTER TABLE public.servicos OWNER TO postgres;
--
-- Name: servicos_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.servicos_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.servicos_id_seq OWNER TO postgres;
--
-- Name: servicos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.servicos_id_seq OWNED BY public.servicos.id;
--
-- Name: status_garantia; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.status_garantia (
id integer NOT NULL,
descricao character varying(100)
);
ALTER TABLE public.status_garantia OWNER TO postgres;
--
-- Name: status_garantia_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.status_garantia_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.status_garantia_id_seq OWNER TO postgres;
--
-- Name: status_garantia_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.status_garantia_id_seq OWNED BY public.status_garantia.id;
--
-- Name: status_ordem_de_servico; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.status_ordem_de_servico (
id integer NOT NULL,
descricao character varying(100)
);
ALTER TABLE public.status_ordem_de_servico OWNER TO postgres;
--
-- Name: status_ordem_de_servico_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.status_ordem_de_servico_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.status_ordem_de_servico_id_seq OWNER TO postgres;
--
-- Name: status_ordem_de_servico_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.status_ordem_de_servico_id_seq OWNED BY public.status_ordem_de_servico.id;
--
-- Name: tecnico; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE public.tecnico (
id integer NOT NULL,
cpf character varying(13),
"endereço" character varying(200),
nome character varying(50),
telefone character varying(12)
);
ALTER TABLE public.tecnico OWNER TO postgres;
--
-- Name: tecnico_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.tecnico_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.tecnico_id_seq OWNER TO postgres;
--
-- Name: tecnico_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.tecnico_id_seq OWNED BY public.tecnico.id;
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.cliente ALTER COLUMN id SET DEFAULT nextval('public.cliente_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.dispositivo ALTER COLUMN id SET DEFAULT nextval('public.dispositivo_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.feed_back ALTER COLUMN id SET DEFAULT nextval('public.feed_back_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.garantia ALTER COLUMN id SET DEFAULT nextval('public.garantia_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.marca ALTER COLUMN id SET DEFAULT nextval('public.marca_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.modelo ALTER COLUMN id SET DEFAULT nextval('public.modelo_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.orcamento ALTER COLUMN id SET DEFAULT nextval('public.orcamento_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.ordem_de_servico ALTER COLUMN id SET DEFAULT nextval('public.ordem_de_servico_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.servicos ALTER COLUMN id SET DEFAULT nextval('public.servicos_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.status_garantia ALTER COLUMN id SET DEFAULT nextval('public.status_garantia_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.status_ordem_de_servico ALTER COLUMN id SET DEFAULT nextval('public.status_ordem_de_servico_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.tecnico ALTER COLUMN id SET DEFAULT nextval('public.tecnico_id_seq'::regclass);
--
-- Name: cliente_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.cliente
ADD CONSTRAINT cliente_pkey PRIMARY KEY (id);
--
-- Name: dispositivo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.dispositivo
ADD CONSTRAINT dispositivo_pkey PRIMARY KEY (id);
--
-- Name: feed_back_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.feed_back
ADD CONSTRAINT feed_back_pkey PRIMARY KEY (id);
--
-- Name: garantia_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.garantia
ADD CONSTRAINT garantia_pkey PRIMARY KEY (id);
--
-- Name: marca_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.marca
ADD CONSTRAINT marca_pkey PRIMARY KEY (id);
--
-- Name: modelo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.modelo
ADD CONSTRAINT modelo_pkey PRIMARY KEY (id);
--
-- Name: orcamento_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.orcamento
ADD CONSTRAINT orcamento_pkey PRIMARY KEY (id);
--
-- Name: ordem_de_servico_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.ordem_de_servico
ADD CONSTRAINT ordem_de_servico_pkey PRIMARY KEY (id);
--
-- Name: ordem_servico_item_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.ordem_servico_item
ADD CONSTRAINT ordem_servico_item_pkey PRIMARY KEY (ordemdeservico_id, servicos_id);
--
-- Name: servicos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.servicos
ADD CONSTRAINT servicos_pkey PRIMARY KEY (id);
--
-- Name: status_garantia_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.status_garantia
ADD CONSTRAINT status_garantia_pkey PRIMARY KEY (id);
--
-- Name: status_ordem_de_servico_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.status_ordem_de_servico
ADD CONSTRAINT status_ordem_de_servico_pkey PRIMARY KEY (id);
--
-- Name: tecnico_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY public.tecnico
ADD CONSTRAINT tecnico_pkey PRIMARY KEY (id);
--
-- Name: fk3hit98r8muhgwn9eej356bg82; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.dispositivo
ADD CONSTRAINT fk3hit98r8muhgwn9eej356bg82 FOREIGN KEY (modelo_id) REFERENCES public.modelo(id);
--
-- Name: fk55tqxpcj427d13xwxsl5vekii; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.garantia
ADD CONSTRAINT fk55tqxpcj427d13xwxsl5vekii FOREIGN KEY (statusgarantia_id) REFERENCES public.status_garantia(id);
--
-- Name: fk5j1e6r18aoxxlpnpldwfcx6jr; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.garantia
ADD CONSTRAINT fk5j1e6r18aoxxlpnpldwfcx6jr FOREIGN KEY (ordemdeservico_id, servico_id) REFERENCES public.ordem_servico_item(ordemdeservico_id, servicos_id);
--
-- Name: fkakia5w376xif20w2auwe351en; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.ordem_de_servico
ADD CONSTRAINT fkakia5w376xif20w2auwe351en FOREIGN KEY (statusordemdeservico_id) REFERENCES public.status_ordem_de_servico(id);
--
-- Name: fkam43o350hfbjaaf5ddo0hjghf; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.ordem_servico_item
ADD CONSTRAINT fkam43o350hfbjaaf5ddo0hjghf FOREIGN KEY (servicos_id) REFERENCES public.servicos(id);
--
-- Name: fkb9gv80090sehtxoqo5xstnfiv; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.orcamento
ADD CONSTRAINT fkb9gv80090sehtxoqo5xstnfiv FOREIGN KEY (cliente_id) REFERENCES public.cliente(id);
--
-- Name: fkb9oigg8h2kylbsiaylf2pkhr0; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.ordem_servico_item
ADD CONSTRAINT fkb9oigg8h2kylbsiaylf2pkhr0 FOREIGN KEY (ordemdeservico_id) REFERENCES public.ordem_de_servico(id);
--
-- Name: fkcxnjhtj47i223ns4vsphcbqnq; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.dispositivo
ADD CONSTRAINT fkcxnjhtj47i223ns4vsphcbqnq FOREIGN KEY (cliente_id) REFERENCES public.cliente(id);
--
-- Name: fkfl0gjtsbgy5po7ewxcyeik0pr; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.feed_back
ADD CONSTRAINT fkfl0gjtsbgy5po7ewxcyeik0pr FOREIGN KEY (ordemdeservico_id) REFERENCES public.ordem_de_servico(id);
--
-- Name: fkj2rkkaxbthrm0jsta7i81bajq; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.orcamento
ADD CONSTRAINT fkj2rkkaxbthrm0jsta7i81bajq FOREIGN KEY (tecnico_id) REFERENCES public.tecnico(id);
--
-- Name: fkllxq2dldvhxvb5q9csar7vdfy; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.modelo
ADD CONSTRAINT fkllxq2dldvhxvb5q9csar7vdfy FOREIGN KEY (marca_id) REFERENCES public.marca(id);
--
-- Name: fkofaemrifs5m3mv8dsxdr55cde; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.ordem_de_servico
ADD CONSTRAINT fkofaemrifs5m3mv8dsxdr55cde FOREIGN KEY (cliente_id) REFERENCES public.cliente(id);
--
-- Name: fkonxx4eckftsmkdg3c4fp0r0ax; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.dispositivo
ADD CONSTRAINT fkonxx4eckftsmkdg3c4fp0r0ax FOREIGN KEY (marca_id) REFERENCES public.marca(id);
--
-- Name: fkounhni5rfmw3qeuswgp2c129r; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.ordem_de_servico
ADD CONSTRAINT fkounhni5rfmw3qeuswgp2c129r FOREIGN KEY (dispositivo_id) REFERENCES public.dispositivo(id);
--
-- Name: fkpmxnkacre2d150cgvkqqq8p6p; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.orcamento
ADD CONSTRAINT fkpmxnkacre2d150cgvkqqq8p6p FOREIGN KEY (dispositivo_id) REFERENCES public.dispositivo(id);
--
-- Name: fktpm6aspie95r37n22tbayjkkm; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.ordem_de_servico
ADD CONSTRAINT fktpm6aspie95r37n22tbayjkkm FOREIGN KEY (tecnico_id) REFERENCES public.tecnico(id);
--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--