source: sandbox/2.3-MailArchiver/doc-expressolivre/debian/arqs-conf/workflow.dump @ 6779

Revision 6779, 26.3 KB checked in by rafaelraymundo, 12 years ago (diff)

Ticket #2946 - Liberado Expresso(branch 2.3) integrado ao MailArchiver?.

Line 
1--
2-- PostgreSQL database dump
3--
4
5SET client_encoding = 'LATIN1';
6SET standard_conforming_strings = off;
7SET check_function_bodies = false;
8SET client_min_messages = warning;
9SET escape_string_warning = off;
10
11--
12-- Name: workflow; Type: DATABASE; Schema: -; Owner: postgres
13--
14
15CREATE DATABASE workflow WITH TEMPLATE = template0 ENCODING = 'LATIN1';
16
17
18ALTER DATABASE workflow OWNER TO postgres;
19
20CREATE USER admin_workflow WITH PASSWORD 'admin_workflow' NOCREATEDB NOCREATEUSER VALID UNTIL 'infinity';
21CREATE GROUP workflow;
22ALTER GROUP workflow ADD USER admin_workflow;
23GRANT workflow TO admin_workflow;
24CREATE USER admin_cds WITH PASSWORD 'admin_cds' NOCREATEDB NOCREATEUSER VALID UNTIL 'infinity';
25ALTER GROUP workflow ADD USER admin_cds;
26GRANT workflow TO admin_cds;
27
28\connect workflow
29
30SET client_encoding = 'LATIN1';
31SET standard_conforming_strings = off;
32SET check_function_bodies = false;
33SET client_min_messages = warning;
34SET escape_string_warning = off;
35
36--
37-- Name: cds; Type: SCHEMA; Schema: -; Owner: admin_cds
38--
39
40CREATE SCHEMA cds;
41
42
43ALTER SCHEMA cds OWNER TO admin_cds;
44
45SET search_path = cds, pg_catalog;
46
47SET default_tablespace = '';
48
49SET default_with_oids = false;
50
51--
52-- Name: cdcollection; Type: TABLE; Schema: cds; Owner: admin_cds; Tablespace:
53--
54
55CREATE TABLE cdcollection (
56    cdid integer NOT NULL,
57    title character varying(200),
58    status character varying(40),
59    usuario character varying(200)
60);
61
62
63ALTER TABLE cds.cdcollection OWNER TO admin_cds;
64
65--
66-- Name: TABLE cdcollection; Type: COMMENT; Schema: cds; Owner: admin_cds
67--
68
69COMMENT ON TABLE cdcollection IS 'Exemplo de Empréstimo de CDs';
70
71
72SET search_path = public, pg_catalog;
73
74--
75-- Name: area; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
76--
77
78CREATE TABLE area (
79    organizacao_id integer NOT NULL,
80    area_id integer NOT NULL,
81    area_status_id integer NOT NULL,
82    areasup_organizacao_id integer,
83    superior_area_id integer,
84    centro_custo_id integer,
85    titular_funcionario_id integer,
86    substituto_funcionario_id integer,
87    sigla character varying(20) NOT NULL,
88    descricao character varying(100) NOT NULL,
89    ativa character varying(1) NOT NULL,
90    auxiliar_funcionario_id integer
91);
92
93
94ALTER TABLE public.area OWNER TO postgres;
95
96--
97-- Name: area_area_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
98--
99
100CREATE SEQUENCE area_area_id_seq
101    START WITH 1
102    INCREMENT BY 1
103    NO MAXVALUE
104    NO MINVALUE
105    CACHE 1;
106
107
108ALTER TABLE public.area_area_id_seq OWNER TO postgres;
109
110--
111-- Name: area_area_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
112--
113
114ALTER SEQUENCE area_area_id_seq OWNED BY area.area_id;
115
116
117--
118-- Name: area_area_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
119--
120
121SELECT pg_catalog.setval('area_area_id_seq', 1, false);
122
123
124--
125-- Name: area_status; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
126--
127
128CREATE TABLE area_status (
129    area_status_id integer NOT NULL,
130    organizacao_id integer NOT NULL,
131    descricao character varying(50) NOT NULL,
132    nivel integer NOT NULL
133);
134
135
136ALTER TABLE public.area_status OWNER TO postgres;
137
138--
139-- Name: area_status_area_status_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
140--
141
142CREATE SEQUENCE area_status_area_status_id_seq
143    START WITH 1
144    INCREMENT BY 1
145    NO MAXVALUE
146    NO MINVALUE
147    CACHE 1;
148
149
150ALTER TABLE public.area_status_area_status_id_seq OWNER TO postgres;
151
152--
153-- Name: area_status_area_status_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
154--
155
156ALTER SEQUENCE area_status_area_status_id_seq OWNED BY area_status.area_status_id;
157
158
159--
160-- Name: area_status_area_status_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
161--
162
163SELECT pg_catalog.setval('area_status_area_status_id_seq', 1, false);
164
165
166--
167-- Name: cargo; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
168--
169
170CREATE TABLE cargo (
171    cargo_id integer NOT NULL,
172    descricao character varying(150),
173    organizacao_id integer
174);
175
176
177ALTER TABLE public.cargo OWNER TO postgres;
178
179--
180-- Name: cargo_cargo_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
181--
182
183CREATE SEQUENCE cargo_cargo_id_seq
184    START WITH 1
185    INCREMENT BY 1
186    NO MAXVALUE
187    NO MINVALUE
188    CACHE 1;
189
190
191ALTER TABLE public.cargo_cargo_id_seq OWNER TO postgres;
192
193--
194-- Name: cargo_cargo_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
195--
196
197ALTER SEQUENCE cargo_cargo_id_seq OWNED BY cargo.cargo_id;
198
199
200--
201-- Name: cargo_cargo_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
202--
203
204SELECT pg_catalog.setval('cargo_cargo_id_seq', 1, false);
205
206
207--
208-- Name: centro_custo; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
209--
210
211CREATE TABLE centro_custo (
212    organizacao_id integer NOT NULL,
213    centro_custo_id integer NOT NULL,
214    nm_centro_custo integer NOT NULL,
215    grupo character varying(30),
216    descricao character varying(100) NOT NULL
217);
218
219
220ALTER TABLE public.centro_custo OWNER TO postgres;
221
222--
223-- Name: centro_custo_centro_custo_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
224--
225
226CREATE SEQUENCE centro_custo_centro_custo_id_seq
227    START WITH 1
228    INCREMENT BY 1
229    NO MAXVALUE
230    NO MINVALUE
231    CACHE 1;
232
233
234ALTER TABLE public.centro_custo_centro_custo_id_seq OWNER TO postgres;
235
236--
237-- Name: centro_custo_centro_custo_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
238--
239
240ALTER SEQUENCE centro_custo_centro_custo_id_seq OWNED BY centro_custo.centro_custo_id;
241
242
243--
244-- Name: centro_custo_centro_custo_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
245--
246
247SELECT pg_catalog.setval('centro_custo_centro_custo_id_seq', 1, false);
248
249
250--
251-- Name: funcionario; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
252--
253
254CREATE TABLE funcionario (
255    funcionario_id integer NOT NULL,
256    area_id integer NOT NULL,
257    localidade_id integer NOT NULL,
258    centro_custo_id integer,
259    organizacao_id integer NOT NULL,
260    funcionario_status_id integer NOT NULL,
261    cargo_id integer,
262    nivel smallint,
263    funcionario_categoria_id integer,
264    titulo character varying(30)
265);
266
267
268ALTER TABLE public.funcionario OWNER TO postgres;
269
270--
271-- Name: funcionario_categoria; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
272--
273
274CREATE TABLE funcionario_categoria (
275    funcionario_categoria_id integer NOT NULL,
276    descricao character varying(150),
277    organizacao_id integer
278);
279
280
281ALTER TABLE public.funcionario_categoria OWNER TO postgres;
282
283--
284-- Name: funcionario_categoria_funcionario_categoria_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
285--
286
287CREATE SEQUENCE funcionario_categoria_funcionario_categoria_id_seq
288    START WITH 1
289    INCREMENT BY 1
290    NO MAXVALUE
291    NO MINVALUE
292    CACHE 1;
293
294
295ALTER TABLE public.funcionario_categoria_funcionario_categoria_id_seq OWNER TO postgres;
296
297--
298-- Name: funcionario_categoria_funcionario_categoria_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
299--
300
301ALTER SEQUENCE funcionario_categoria_funcionario_categoria_id_seq OWNED BY funcionario_categoria.funcionario_categoria_id;
302
303
304--
305-- Name: funcionario_categoria_funcionario_categoria_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
306--
307
308SELECT pg_catalog.setval('funcionario_categoria_funcionario_categoria_id_seq', 1, false);
309
310
311--
312-- Name: funcionario_status; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
313--
314
315CREATE TABLE funcionario_status (
316    funcionario_status_id integer NOT NULL,
317    descricao character varying(50) NOT NULL,
318    exibir character varying(1) NOT NULL,
319    organizacao_id integer NOT NULL
320);
321
322
323ALTER TABLE public.funcionario_status OWNER TO postgres;
324
325--
326-- Name: funcionario_status_funcionario_status_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
327--
328
329CREATE SEQUENCE funcionario_status_funcionario_status_id_seq
330    START WITH 1
331    INCREMENT BY 1
332    NO MAXVALUE
333    NO MINVALUE
334    CACHE 1;
335
336
337ALTER TABLE public.funcionario_status_funcionario_status_id_seq OWNER TO postgres;
338
339--
340-- Name: funcionario_status_funcionario_status_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
341--
342
343ALTER SEQUENCE funcionario_status_funcionario_status_id_seq OWNED BY funcionario_status.funcionario_status_id;
344
345
346--
347-- Name: funcionario_status_funcionario_status_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
348--
349
350SELECT pg_catalog.setval('funcionario_status_funcionario_status_id_seq', 1, false);
351
352
353--
354-- Name: localidade; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
355--
356
357CREATE TABLE localidade (
358    organizacao_id integer NOT NULL,
359    localidade_id integer NOT NULL,
360    centro_custo_id integer,
361    descricao character varying(50) NOT NULL,
362    empresa character varying(100),
363    endereco character varying(100),
364    complemento character varying(50),
365    cep character varying(9),
366    bairro character varying(30),
367    cidade character varying(50),
368    uf character varying(2)
369);
370
371
372ALTER TABLE public.localidade OWNER TO postgres;
373
374--
375-- Name: localidade_localidade_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
376--
377
378CREATE SEQUENCE localidade_localidade_id_seq
379    START WITH 1
380    INCREMENT BY 1
381    NO MAXVALUE
382    NO MINVALUE
383    CACHE 1;
384
385
386ALTER TABLE public.localidade_localidade_id_seq OWNER TO postgres;
387
388--
389-- Name: localidade_localidade_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
390--
391
392ALTER SEQUENCE localidade_localidade_id_seq OWNED BY localidade.localidade_id;
393
394
395--
396-- Name: localidade_localidade_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
397--
398
399SELECT pg_catalog.setval('localidade_localidade_id_seq', 1, false);
400
401
402--
403-- Name: organizacao; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
404--
405
406CREATE TABLE organizacao (
407    organizacao_id integer NOT NULL,
408    nome character varying(20) NOT NULL,
409    descricao character varying(100) NOT NULL,
410    url_imagem character varying(200),
411    ativa character varying(1) NOT NULL,
412    sitio character varying(100)
413);
414
415
416ALTER TABLE public.organizacao OWNER TO postgres;
417
418--
419-- Name: organizacao_organizacao_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
420--
421
422CREATE SEQUENCE organizacao_organizacao_id_seq
423    START WITH 1
424    INCREMENT BY 1
425    NO MAXVALUE
426    NO MINVALUE
427    CACHE 1;
428
429
430ALTER TABLE public.organizacao_organizacao_id_seq OWNER TO postgres;
431
432--
433-- Name: organizacao_organizacao_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
434--
435
436ALTER SEQUENCE organizacao_organizacao_id_seq OWNED BY organizacao.organizacao_id;
437
438
439--
440-- Name: organizacao_organizacao_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
441--
442
443SELECT pg_catalog.setval('organizacao_organizacao_id_seq', 1, false);
444
445
446--
447-- Name: telefone; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
448--
449
450CREATE TABLE telefone (
451    telefone_id integer NOT NULL,
452    descricao character varying(50) NOT NULL,
453    numero character varying(50) NOT NULL,
454    organizacao_id integer NOT NULL
455);
456
457
458ALTER TABLE public.telefone OWNER TO postgres;
459
460--
461-- Name: telefone_telefone_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
462--
463
464CREATE SEQUENCE telefone_telefone_id_seq
465    START WITH 1
466    INCREMENT BY 1
467    NO MAXVALUE
468    NO MINVALUE
469    CACHE 1;
470
471
472ALTER TABLE public.telefone_telefone_id_seq OWNER TO postgres;
473
474--
475-- Name: telefone_telefone_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
476--
477
478ALTER SEQUENCE telefone_telefone_id_seq OWNED BY telefone.telefone_id;
479
480
481--
482-- Name: telefone_telefone_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
483--
484
485SELECT pg_catalog.setval('telefone_telefone_id_seq', 1, false);
486
487
488--
489-- Name: telefone_id; Type: DEFAULT; Schema: public; Owner: postgres
490--
491
492ALTER TABLE telefone ALTER COLUMN telefone_id SET DEFAULT nextval('telefone_telefone_id_seq'::regclass);
493
494
495--
496-- Name: telefone_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
497--
498
499ALTER TABLE ONLY telefone
500    ADD CONSTRAINT telefone_pkey PRIMARY KEY (telefone_id);
501
502
503--
504-- Name: area_id; Type: DEFAULT; Schema: public; Owner: postgres
505--
506
507ALTER TABLE area ALTER COLUMN area_id SET DEFAULT nextval('area_area_id_seq'::regclass);
508
509
510--
511-- Name: area_status_id; Type: DEFAULT; Schema: public; Owner: postgres
512--
513
514ALTER TABLE area_status ALTER COLUMN area_status_id SET DEFAULT nextval('area_status_area_status_id_seq'::regclass);
515
516
517--
518-- Name: cargo_id; Type: DEFAULT; Schema: public; Owner: postgres
519--
520
521ALTER TABLE cargo ALTER COLUMN cargo_id SET DEFAULT nextval('cargo_cargo_id_seq'::regclass);
522
523
524--
525-- Name: centro_custo_id; Type: DEFAULT; Schema: public; Owner: postgres
526--
527
528ALTER TABLE centro_custo ALTER COLUMN centro_custo_id SET DEFAULT nextval('centro_custo_centro_custo_id_seq'::regclass);
529
530
531--
532-- Name: funcionario_categoria_id; Type: DEFAULT; Schema: public; Owner: postgres
533--
534
535ALTER TABLE funcionario_categoria ALTER COLUMN funcionario_categoria_id SET DEFAULT nextval('funcionario_categoria_funcionario_categoria_id_seq'::regclass);
536
537
538--
539-- Name: funcionario_status_id; Type: DEFAULT; Schema: public; Owner: postgres
540--
541
542ALTER TABLE funcionario_status ALTER COLUMN funcionario_status_id SET DEFAULT nextval('funcionario_status_funcionario_status_id_seq'::regclass);
543
544
545--
546-- Name: localidade_id; Type: DEFAULT; Schema: public; Owner: postgres
547--
548
549ALTER TABLE localidade ALTER COLUMN localidade_id SET DEFAULT nextval('localidade_localidade_id_seq'::regclass);
550
551
552--
553-- Name: organizacao_id; Type: DEFAULT; Schema: public; Owner: postgres
554--
555
556ALTER TABLE organizacao ALTER COLUMN organizacao_id SET DEFAULT nextval('organizacao_organizacao_id_seq'::regclass);
557
558
559SET search_path = cds, pg_catalog;
560
561--
562-- Data for Name: cdcollection; Type: TABLE DATA; Schema: cds; Owner: admin_cds
563--
564
565INSERT INTO cdcollection VALUES (1, 'Compact Disc 1', 'disponivel', NULL);
566INSERT INTO cdcollection VALUES (2, 'Compact Disc 2', 'disponivel', NULL);
567INSERT INTO cdcollection VALUES (3, 'Compact Disc 3', 'disponivel', NULL);
568
569
570SET search_path = cds, pg_catalog;
571
572--
573-- Name: cdcollection_pkey; Type: CONSTRAINT; Schema: cds; Owner: admin_cds; Tablespace:
574--
575
576ALTER TABLE ONLY cdcollection
577    ADD CONSTRAINT cdcollection_pkey PRIMARY KEY (cdid);
578
579
580SET search_path = public, pg_catalog;
581
582--
583-- Name: area_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
584--
585
586ALTER TABLE ONLY area
587    ADD CONSTRAINT area_pkey PRIMARY KEY (organizacao_id, area_id);
588
589
590--
591-- Name: areastatus_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
592--
593
594ALTER TABLE ONLY area_status
595    ADD CONSTRAINT areastatus_pkey PRIMARY KEY (area_status_id, organizacao_id);
596
597
598--
599-- Name: centrocusto_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
600--
601
602ALTER TABLE ONLY centro_custo
603    ADD CONSTRAINT centrocusto_pkey PRIMARY KEY (organizacao_id, centro_custo_id);
604
605
606--
607-- Name: funcionario_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
608--
609
610ALTER TABLE ONLY funcionario
611    ADD CONSTRAINT funcionario_pkey PRIMARY KEY (funcionario_id);
612
613
614--
615-- Name: funcionario_status_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
616--
617
618ALTER TABLE ONLY funcionario_status
619    ADD CONSTRAINT funcionario_status_pkey PRIMARY KEY (funcionario_status_id);
620
621
622--
623-- Name: localidade_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
624--
625
626ALTER TABLE ONLY localidade
627    ADD CONSTRAINT localidade_pkey PRIMARY KEY (organizacao_id, localidade_id);
628
629
630--
631-- Name: organizacao_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
632--
633
634ALTER TABLE ONLY organizacao
635    ADD CONSTRAINT organizacao_pkey PRIMARY KEY (organizacao_id);
636
637
638--
639-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
640--
641
642ALTER TABLE ONLY funcionario_status
643    ADD CONSTRAINT "$1" FOREIGN KEY (organizacao_id) REFERENCES organizacao(organizacao_id);
644
645
646--
647-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
648--
649
650ALTER TABLE ONLY area_status
651    ADD CONSTRAINT "$1" FOREIGN KEY (organizacao_id) REFERENCES organizacao(organizacao_id);
652
653
654--
655-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
656--
657
658ALTER TABLE ONLY centro_custo
659    ADD CONSTRAINT "$1" FOREIGN KEY (organizacao_id) REFERENCES organizacao(organizacao_id);
660
661
662--
663-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
664--
665
666ALTER TABLE ONLY localidade
667    ADD CONSTRAINT "$1" FOREIGN KEY (centro_custo_id, organizacao_id) REFERENCES centro_custo(centro_custo_id, organizacao_id);
668
669
670--
671-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
672--
673
674ALTER TABLE ONLY funcionario
675    ADD CONSTRAINT "$1" FOREIGN KEY (organizacao_id, centro_custo_id) REFERENCES centro_custo(organizacao_id, centro_custo_id);
676
677
678--
679-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
680--
681
682ALTER TABLE ONLY area
683    ADD CONSTRAINT "$1" FOREIGN KEY (superior_area_id, areasup_organizacao_id) REFERENCES area(area_id, organizacao_id);
684
685
686--
687-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
688--
689
690ALTER TABLE ONLY localidade
691    ADD CONSTRAINT "$2" FOREIGN KEY (organizacao_id) REFERENCES organizacao(organizacao_id);
692
693
694--
695-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
696--
697
698ALTER TABLE ONLY funcionario
699    ADD CONSTRAINT "$2" FOREIGN KEY (organizacao_id, localidade_id) REFERENCES localidade(organizacao_id, localidade_id);
700
701
702--
703-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
704--
705
706ALTER TABLE ONLY area
707    ADD CONSTRAINT "$2" FOREIGN KEY (centro_custo_id, organizacao_id) REFERENCES centro_custo(centro_custo_id, organizacao_id);
708
709
710--
711-- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
712--
713
714ALTER TABLE ONLY funcionario
715    ADD CONSTRAINT "$3" FOREIGN KEY (organizacao_id, area_id) REFERENCES area(organizacao_id, area_id);
716
717
718--
719-- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
720--
721
722ALTER TABLE ONLY area
723    ADD CONSTRAINT "$3" FOREIGN KEY (titular_funcionario_id) REFERENCES funcionario(funcionario_id);
724
725
726--
727-- Name: $4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
728--
729
730ALTER TABLE ONLY funcionario
731    ADD CONSTRAINT "$4" FOREIGN KEY (funcionario_status_id) REFERENCES funcionario_status(funcionario_status_id);
732
733
734--
735-- Name: $4; Type: FK CONSTRAINT; Schema: public; Owner: postgres
736--
737
738ALTER TABLE ONLY area
739    ADD CONSTRAINT "$4" FOREIGN KEY (substituto_funcionario_id) REFERENCES funcionario(funcionario_id);
740
741
742--
743-- Name: $5; Type: FK CONSTRAINT; Schema: public; Owner: postgres
744--
745
746ALTER TABLE ONLY area
747    ADD CONSTRAINT "$5" FOREIGN KEY (organizacao_id) REFERENCES organizacao(organizacao_id);
748
749
750--
751-- Name: $6; Type: FK CONSTRAINT; Schema: public; Owner: postgres
752--
753
754ALTER TABLE ONLY area
755    ADD CONSTRAINT "$6" FOREIGN KEY (area_status_id, organizacao_id) REFERENCES area_status(area_status_id, organizacao_id);
756
757
758--
759-- Name: $7; Type: FK CONSTRAINT; Schema: public; Owner: postgres
760--
761
762ALTER TABLE ONLY area
763    ADD CONSTRAINT "$7" FOREIGN KEY (auxiliar_funcionario_id) REFERENCES funcionario(funcionario_id);
764
765--
766-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
767--
768
769ALTER TABLE ONLY telefone
770    ADD CONSTRAINT "$1" FOREIGN KEY (organizacao_id) REFERENCES organizacao(organizacao_id);
771
772
773--
774-- Name: cds; Type: ACL; Schema: -; Owner: admin_cds
775--
776
777REVOKE ALL ON SCHEMA cds FROM PUBLIC;
778REVOKE ALL ON SCHEMA cds FROM admin_cds;
779GRANT ALL ON SCHEMA cds TO admin_cds;
780GRANT ALL ON SCHEMA cds TO postgres;
781
782
783--
784-- Name: public; Type: ACL; Schema: -; Owner: postgres
785--
786
787REVOKE ALL ON SCHEMA public FROM PUBLIC;
788REVOKE ALL ON SCHEMA public FROM postgres;
789GRANT ALL ON SCHEMA public TO postgres;
790GRANT ALL ON SCHEMA public TO PUBLIC;
791
792
793SET search_path = cds, pg_catalog;
794
795--
796-- Name: cdcollection; Type: ACL; Schema: cds; Owner: admin_cds
797--
798
799REVOKE ALL ON TABLE cdcollection FROM PUBLIC;
800REVOKE ALL ON TABLE cdcollection FROM admin_cds;
801GRANT ALL ON TABLE cdcollection TO admin_cds;
802GRANT ALL ON TABLE cdcollection TO postgres WITH GRANT OPTION;
803
804
805SET search_path = public, pg_catalog;
806
807--
808-- Name: area; Type: ACL; Schema: public; Owner: postgres
809--
810
811REVOKE ALL ON TABLE area FROM PUBLIC;
812REVOKE ALL ON TABLE area FROM postgres;
813GRANT ALL ON TABLE area TO postgres;
814GRANT ALL ON TABLE area TO admin_workflow;
815GRANT SELECT ON TABLE area TO PUBLIC;
816
817
818--
819-- Name: area_area_id_seq; Type: ACL; Schema: public; Owner: postgres
820--
821
822REVOKE ALL ON SEQUENCE area_area_id_seq FROM PUBLIC;
823REVOKE ALL ON SEQUENCE area_area_id_seq FROM postgres;
824GRANT ALL ON SEQUENCE area_area_id_seq TO postgres;
825GRANT ALL ON SEQUENCE area_area_id_seq TO admin_workflow;
826GRANT SELECT ON SEQUENCE area_area_id_seq TO PUBLIC;
827
828
829--
830-- Name: area_status; Type: ACL; Schema: public; Owner: postgres
831--
832
833REVOKE ALL ON TABLE area_status FROM PUBLIC;
834REVOKE ALL ON TABLE area_status FROM postgres;
835GRANT ALL ON TABLE area_status TO postgres;
836GRANT ALL ON TABLE area_status TO admin_workflow;
837GRANT SELECT ON TABLE area_status TO PUBLIC;
838
839
840--
841-- Name: area_status_area_status_id_seq; Type: ACL; Schema: public; Owner: postgres
842--
843
844REVOKE ALL ON SEQUENCE area_status_area_status_id_seq FROM PUBLIC;
845REVOKE ALL ON SEQUENCE area_status_area_status_id_seq FROM postgres;
846GRANT ALL ON SEQUENCE area_status_area_status_id_seq TO postgres;
847GRANT ALL ON SEQUENCE area_status_area_status_id_seq TO admin_workflow;
848GRANT SELECT ON SEQUENCE area_status_area_status_id_seq TO PUBLIC;
849
850
851--
852-- Name: cargo; Type: ACL; Schema: public; Owner: postgres
853--
854
855REVOKE ALL ON TABLE cargo FROM PUBLIC;
856REVOKE ALL ON TABLE cargo FROM postgres;
857GRANT ALL ON TABLE cargo TO postgres;
858GRANT ALL ON TABLE cargo TO admin_workflow;
859GRANT SELECT ON TABLE cargo TO PUBLIC;
860
861
862--
863-- Name: cargo_cargo_id_seq; Type: ACL; Schema: public; Owner: postgres
864--
865
866REVOKE ALL ON SEQUENCE cargo_cargo_id_seq FROM PUBLIC;
867REVOKE ALL ON SEQUENCE cargo_cargo_id_seq FROM postgres;
868GRANT ALL ON SEQUENCE cargo_cargo_id_seq TO postgres;
869GRANT ALL ON SEQUENCE cargo_cargo_id_seq TO admin_workflow;
870GRANT SELECT ON SEQUENCE cargo_cargo_id_seq TO PUBLIC;
871
872
873--
874-- Name: centro_custo; Type: ACL; Schema: public; Owner: postgres
875--
876
877REVOKE ALL ON TABLE centro_custo FROM PUBLIC;
878REVOKE ALL ON TABLE centro_custo FROM postgres;
879GRANT ALL ON TABLE centro_custo TO postgres;
880GRANT ALL ON TABLE centro_custo TO admin_workflow;
881GRANT SELECT ON TABLE centro_custo TO PUBLIC;
882
883
884--
885-- Name: centro_custo_centro_custo_id_seq; Type: ACL; Schema: public; Owner: postgres
886--
887
888REVOKE ALL ON SEQUENCE centro_custo_centro_custo_id_seq FROM PUBLIC;
889REVOKE ALL ON SEQUENCE centro_custo_centro_custo_id_seq FROM postgres;
890GRANT ALL ON SEQUENCE centro_custo_centro_custo_id_seq TO postgres;
891GRANT ALL ON SEQUENCE centro_custo_centro_custo_id_seq TO admin_workflow;
892GRANT SELECT ON SEQUENCE centro_custo_centro_custo_id_seq TO PUBLIC;
893
894
895--
896-- Name: funcionario; Type: ACL; Schema: public; Owner: postgres
897--
898
899REVOKE ALL ON TABLE funcionario FROM PUBLIC;
900REVOKE ALL ON TABLE funcionario FROM postgres;
901GRANT ALL ON TABLE funcionario TO postgres;
902GRANT ALL ON TABLE funcionario TO admin_workflow;
903GRANT SELECT ON TABLE funcionario TO PUBLIC;
904
905
906--
907-- Name: funcionario_categoria; Type: ACL; Schema: public; Owner: postgres
908--
909
910REVOKE ALL ON TABLE funcionario_categoria FROM PUBLIC;
911REVOKE ALL ON TABLE funcionario_categoria FROM postgres;
912GRANT ALL ON TABLE funcionario_categoria TO postgres;
913GRANT ALL ON TABLE funcionario_categoria TO admin_workflow;
914GRANT SELECT ON TABLE funcionario_categoria TO PUBLIC;
915
916
917--
918-- Name: funcionario_categoria_funcionario_categoria_id_seq; Type: ACL; Schema: public; Owner: postgres
919--
920
921REVOKE ALL ON SEQUENCE funcionario_categoria_funcionario_categoria_id_seq FROM PUBLIC;
922REVOKE ALL ON SEQUENCE funcionario_categoria_funcionario_categoria_id_seq FROM postgres;
923GRANT ALL ON SEQUENCE funcionario_categoria_funcionario_categoria_id_seq TO postgres;
924GRANT ALL ON SEQUENCE funcionario_categoria_funcionario_categoria_id_seq TO admin_workflow;
925GRANT SELECT ON SEQUENCE funcionario_categoria_funcionario_categoria_id_seq TO PUBLIC;
926
927
928--
929-- Name: funcionario_status; Type: ACL; Schema: public; Owner: postgres
930--
931
932REVOKE ALL ON TABLE funcionario_status FROM PUBLIC;
933REVOKE ALL ON TABLE funcionario_status FROM postgres;
934GRANT ALL ON TABLE funcionario_status TO postgres;
935GRANT ALL ON TABLE funcionario_status TO admin_workflow;
936GRANT SELECT ON TABLE funcionario_status TO PUBLIC;
937
938
939--
940-- Name: funcionario_status_funcionario_status_id_seq; Type: ACL; Schema: public; Owner: postgres
941--
942
943REVOKE ALL ON SEQUENCE funcionario_status_funcionario_status_id_seq FROM PUBLIC;
944REVOKE ALL ON SEQUENCE funcionario_status_funcionario_status_id_seq FROM postgres;
945GRANT ALL ON SEQUENCE funcionario_status_funcionario_status_id_seq TO postgres;
946GRANT ALL ON SEQUENCE funcionario_status_funcionario_status_id_seq TO admin_workflow;
947GRANT SELECT ON SEQUENCE funcionario_status_funcionario_status_id_seq TO PUBLIC;
948
949
950--
951-- Name: localidade; Type: ACL; Schema: public; Owner: postgres
952--
953
954REVOKE ALL ON TABLE localidade FROM PUBLIC;
955REVOKE ALL ON TABLE localidade FROM postgres;
956GRANT ALL ON TABLE localidade TO postgres;
957GRANT ALL ON TABLE localidade TO admin_workflow;
958GRANT SELECT ON TABLE localidade TO PUBLIC;
959
960
961--
962-- Name: localidade_localidade_id_seq; Type: ACL; Schema: public; Owner: postgres
963--
964
965REVOKE ALL ON SEQUENCE localidade_localidade_id_seq FROM PUBLIC;
966REVOKE ALL ON SEQUENCE localidade_localidade_id_seq FROM postgres;
967GRANT ALL ON SEQUENCE localidade_localidade_id_seq TO postgres;
968GRANT ALL ON SEQUENCE localidade_localidade_id_seq TO admin_workflow;
969GRANT SELECT ON SEQUENCE localidade_localidade_id_seq TO PUBLIC;
970
971
972--
973-- Name: organizacao; Type: ACL; Schema: public; Owner: postgres
974--
975
976REVOKE ALL ON TABLE organizacao FROM PUBLIC;
977REVOKE ALL ON TABLE organizacao FROM postgres;
978GRANT ALL ON TABLE organizacao TO postgres;
979GRANT ALL ON TABLE organizacao TO admin_workflow;
980GRANT SELECT ON TABLE organizacao TO PUBLIC;
981
982
983--
984-- Name: organizacao_organizacao_id_seq; Type: ACL; Schema: public; Owner: postgres
985--
986
987REVOKE ALL ON SEQUENCE organizacao_organizacao_id_seq FROM PUBLIC;
988REVOKE ALL ON SEQUENCE organizacao_organizacao_id_seq FROM postgres;
989GRANT ALL ON SEQUENCE organizacao_organizacao_id_seq TO postgres;
990GRANT ALL ON SEQUENCE organizacao_organizacao_id_seq TO admin_workflow;
991GRANT SELECT ON SEQUENCE organizacao_organizacao_id_seq TO PUBLIC;
992
993
994--
995-- Name: telefone; Type: ACL; Schema: public; Owner: postgres
996--
997
998REVOKE ALL ON TABLE telefone FROM PUBLIC;
999REVOKE ALL ON TABLE telefone FROM postgres;
1000GRANT ALL ON TABLE telefone TO postgres;
1001GRANT ALL ON TABLE telefone TO admin_workflow;
1002GRANT SELECT ON TABLE telefone TO PUBLIC;
1003
1004
1005--
1006-- Name: telefone_telefone_id_seq; Type: ACL; Schema: public; Owner: postgres
1007--
1008
1009REVOKE ALL ON SEQUENCE telefone_telefone_id_seq FROM PUBLIC;
1010REVOKE ALL ON SEQUENCE telefone_telefone_id_seq FROM postgres;
1011GRANT ALL ON SEQUENCE telefone_telefone_id_seq TO postgres;
1012GRANT ALL ON SEQUENCE telefone_telefone_id_seq TO admin_workflow;
1013GRANT SELECT ON SEQUENCE telefone_telefone_id_seq TO PUBLIC;
1014
1015
1016--
1017-- PostgreSQL database dump complete
1018--
1019
Note: See TracBrowser for help on using the repository browser.