Commit 3a280838696fcd64534c744a52cef50503457623
1 parent
d855b5b6
Exists in
master
Redmine #4679 Terminando alteração do modelo
Showing
5 changed files
with
1448 additions
and
206 deletions
Show diff stats
cit-adm-materiais-api/src/main/java/br/com/centralit/api/model/MaterialConsumo.java
... | ... | @@ -7,6 +7,7 @@ import javax.persistence.Entity; |
7 | 7 | import javax.persistence.FetchType; |
8 | 8 | import javax.persistence.ManyToOne; |
9 | 9 | import javax.persistence.OneToMany; |
10 | +import javax.persistence.Table; | |
10 | 11 | |
11 | 12 | import org.hibernate.envers.Audited; |
12 | 13 | |
... | ... | @@ -50,6 +51,7 @@ import com.fasterxml.jackson.annotation.JsonView; |
50 | 51 | */ |
51 | 52 | @Audited |
52 | 53 | @Entity |
54 | +@Table(name="alm_materialconsumo") | |
53 | 55 | @JsonIgnoreProperties({ "dominioUnidadeMedida", "materiaisConsumo" }) |
54 | 56 | public class MaterialConsumo extends Material { |
55 | 57 | ... | ... |
cit-adm-materiais-api/src/main/java/br/com/centralit/api/model/MaterialConsumoTipoUnidadeMedidaEntrada.java
... | ... | @@ -8,7 +8,6 @@ import javax.persistence.Id; |
8 | 8 | import javax.persistence.ManyToOne; |
9 | 9 | import javax.persistence.Table; |
10 | 10 | |
11 | -import org.hibernate.envers.AuditTable; | |
12 | 11 | import org.hibernate.envers.Audited; |
13 | 12 | |
14 | 13 | import br.com.centralit.api.framework.json.ViewsAdmMateriais; |
... | ... | @@ -19,9 +18,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
19 | 18 | import com.fasterxml.jackson.annotation.JsonView; |
20 | 19 | |
21 | 20 | @Audited |
22 | -@AuditTable(value = "MatConsTpUnEntrada_aud") | |
23 | 21 | @Entity |
24 | -@Table(name="MatConsumoTipoUnidadeEntrada") | |
22 | +@Table(name="alm_mc_unidmedidaentrada") | |
25 | 23 | @JsonIgnoreProperties({ "$edit", "$checked" }) |
26 | 24 | public class MaterialConsumoTipoUnidadeMedidaEntrada extends PersistentObject { |
27 | 25 | ... | ... |
cit-adm-materiais-api/src/main/java/br/com/centralit/api/model/MaterialPermanenteConsumo.java
... | ... | @@ -6,8 +6,8 @@ import javax.persistence.GeneratedValue; |
6 | 6 | import javax.persistence.GenerationType; |
7 | 7 | import javax.persistence.Id; |
8 | 8 | import javax.persistence.ManyToOne; |
9 | +import javax.persistence.Table; | |
9 | 10 | |
10 | -import org.hibernate.envers.AuditTable; | |
11 | 11 | import org.hibernate.envers.Audited; |
12 | 12 | |
13 | 13 | import br.com.centralit.framework.json.Views; |
... | ... | @@ -49,8 +49,8 @@ import com.fasterxml.jackson.annotation.JsonView; |
49 | 49 | * |
50 | 50 | */ |
51 | 51 | @Audited |
52 | -@AuditTable(value = "MatPermanCons_aud") | |
53 | 52 | @Entity |
53 | +@Table(name = "mat_matpermanenteconsumo") | |
54 | 54 | @JsonIgnoreProperties({ "$checked" }) |
55 | 55 | public class MaterialPermanenteConsumo extends PersistentObjectAudit { |
56 | 56 | ... | ... |
cit-adm-materiais-api/src/main/resources/scripts-bd/postgres/v1.14.0/01-cit-adm-materiais-v1.14.0-postgres.sql
... | ... | @@ -1,201 +0,0 @@ |
1 | --- GEOVANE INICIO 27/04/2016 | |
2 | -ALTER TABLE entradaalmoxarifado | |
3 | - ADD databloqueio date, | |
4 | - ADD datainativo date, | |
5 | - ADD datacriacao timestamp without time zone, -- datacriacao timestamp without time zone NOT NULL, | |
6 | - ADD dataedicao timestamp without time zone, -- dataedicao timestamp without time zone NOT NULL, | |
7 | - ADD version bigint, | |
8 | - ADD codigo character varying(30), | |
9 | - ADD codigoasi character varying(30), | |
10 | - ADD datacontabil timestamp without time zone, | |
11 | - ADD datarecebimento timestamp without time zone, | |
12 | - ADD datareferencia timestamp without time zone, -- datareferencia timestamp without time zone NOT NULL, | |
13 | - ADD valortotalnota numeric(20,2), | |
14 | - ADD inativador_id bigint, | |
15 | - ADD autor_id bigint, | |
16 | - ADD editor_id bigint, | |
17 | - ADD organizacao_id bigint, | |
18 | - ADD dominiotipoentrada_id bigint, -- dominiotipoentrada_id bigint NOT NULL, | |
19 | - ADD dominiotiporecebimento_id bigint, -- dominiotiporecebimento_id bigint NOT NULL, | |
20 | - ADD fornecedor_id bigint, -- fornecedor_id bigint NOT NULL, | |
21 | - ADD isentradaconcluida boolean, | |
22 | - ADD iscontabilizada boolean, | |
23 | - ADD CONSTRAINT fk_969g9yg5boknrdf70y841q1si FOREIGN KEY (fornecedor_id) | |
24 | - REFERENCES parceiro (id) MATCH SIMPLE | |
25 | - ON UPDATE NO ACTION ON DELETE NO ACTION, | |
26 | - ADD CONSTRAINT fk_anacinjl3sr1eelyk1pw8ugvy FOREIGN KEY (inativador_id) | |
27 | - REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
28 | - ON UPDATE NO ACTION ON DELETE NO ACTION, | |
29 | - ADD CONSTRAINT fk_b3amxqm9rtvuf7ilrqkq57hjd FOREIGN KEY (organizacao_id) | |
30 | - REFERENCES organizacao (id) MATCH SIMPLE | |
31 | - ON UPDATE NO ACTION ON DELETE NO ACTION, | |
32 | - ADD CONSTRAINT fk_g0sybxnce81d2233pjblwl17r FOREIGN KEY (dominiotiporecebimento_id) | |
33 | - REFERENCES dominio (id) MATCH SIMPLE | |
34 | - ON UPDATE NO ACTION ON DELETE NO ACTION, | |
35 | - ADD CONSTRAINT fk_kdr5va9arw1cdhfrnf7as5ri2 FOREIGN KEY (autor_id) | |
36 | - REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
37 | - ON UPDATE NO ACTION ON DELETE NO ACTION, | |
38 | - ADD CONSTRAINT fk_nk61i4sij66popjelwsw7rlf2 FOREIGN KEY (dominiotipoentrada_id) | |
39 | - REFERENCES dominio (id) MATCH SIMPLE | |
40 | - ON UPDATE NO ACTION ON DELETE NO ACTION, | |
41 | - ADD CONSTRAINT fk_sguawd35twwkcj48x1p4dc2pt FOREIGN KEY (editor_id) | |
42 | - REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
43 | - ON UPDATE NO ACTION ON DELETE NO ACTION; | |
44 | - | |
45 | -ALTER TABLE entradaalmoxarifado_aud | |
46 | - ADD databloqueio date, | |
47 | - ADD datainativo date, | |
48 | - ADD datacriacao timestamp without time zone, | |
49 | - ADD dataedicao timestamp without time zone, | |
50 | - ADD version bigint, | |
51 | - ADD codigo character varying(30), | |
52 | - ADD codigoasi character varying(30), | |
53 | - ADD datacontabil timestamp without time zone, | |
54 | - ADD datarecebimento timestamp without time zone, | |
55 | - ADD datareferencia timestamp without time zone, | |
56 | - ADD valortotalnota numeric(20,2), | |
57 | - ADD inativador_id bigint, | |
58 | - ADD autor_id bigint, | |
59 | - ADD editor_id bigint, | |
60 | - ADD organizacao_id bigint, | |
61 | - ADD dominiotipoentrada_id bigint, | |
62 | - ADD dominiotiporecebimento_id bigint, | |
63 | - ADD fornecedor_id bigint, | |
64 | - ADD isentradaconcluida boolean, | |
65 | - ADD iscontabilizada boolean; | |
66 | - | |
67 | -ALTER TABLE entradaalmoxarifado | |
68 | - DROP CONSTRAINT fk_i9gl9a320scs2op2befsjvxh1; | |
69 | - | |
70 | -UPDATE | |
71 | - entradaalmoxarifado | |
72 | -SET | |
73 | - databloqueio = ent.databloqueio, | |
74 | - datainativo = ent.datainativo, | |
75 | - datacriacao = ent.datacriacao, | |
76 | - dataedicao = ent.dataedicao, | |
77 | - version = ent.version, | |
78 | - codigo = ent.codigo, | |
79 | - codigoasi = ent.codigoasi, | |
80 | - datacontabil = ent.datacontabil, | |
81 | - datarecebimento = ent.datarecebimento, | |
82 | - datareferencia = ent.datareferencia, | |
83 | - valortotalnota = ent.valortotalnota, | |
84 | - inativador_id = ent.inativador_id, | |
85 | - autor_id = ent.autor_id, | |
86 | - editor_id = ent.editor_id, | |
87 | - organizacao_id = ent.organizacao_id, | |
88 | - dominiotipoentrada_id = ent.dominiotipoentrada_id, | |
89 | - dominiotiporecebimento_id = ent.dominiotiporecebimento_id, | |
90 | - fornecedor_id = ent.fornecedor_id, | |
91 | - isentradaconcluida = ent.isentradaconcluida, | |
92 | - iscontabilizada = ent.iscontabilizada | |
93 | -FROM | |
94 | - (SELECT * FROM entrada) ent | |
95 | -WHERE | |
96 | - ent.id = entradaalmoxarifado.id; | |
97 | - | |
98 | -ALTER TABLE entradaalmoxarifado_aud | |
99 | - ADD revtype smallint; | |
100 | - | |
101 | -UPDATE | |
102 | - entradaalmoxarifado_aud | |
103 | -SET | |
104 | - databloqueio = ent.databloqueio, | |
105 | - datainativo = ent.datainativo, | |
106 | - datacriacao = ent.datacriacao, | |
107 | - dataedicao = ent.dataedicao, | |
108 | - codigo = ent.codigo, | |
109 | - codigoasi = ent.codigoasi, | |
110 | - datacontabil = ent.datacontabil, | |
111 | - datarecebimento = ent.datarecebimento, | |
112 | - datareferencia = ent.datareferencia, | |
113 | - valortotalnota = ent.valortotalnota, | |
114 | - autor_id = ent.autor_id, | |
115 | - editor_id = ent.editor_id, | |
116 | - dominiotipoentrada_id = ent.dominiotipoentrada_id, | |
117 | - dominiotiporecebimento_id = ent.dominiotiporecebimento_id, | |
118 | - isentradaconcluida = ent.isentradaconcluida, | |
119 | - iscontabilizada = ent.iscontabilizada, | |
120 | - rev = ent.rev, | |
121 | - revtype = ent.revtype | |
122 | -FROM | |
123 | - (SELECT * FROM entrada_aud) ent | |
124 | -WHERE | |
125 | - ent.id = entradaalmoxarifado_aud.id; | |
126 | - | |
127 | -CREATE TABLE entradaalmoxarifadodocumento | |
128 | -( | |
129 | - id bigint NOT NULL, | |
130 | - entrada_id bigint, | |
131 | - entradainativo_id bigint, | |
132 | - CONSTRAINT entradaalmdocumento_pkey PRIMARY KEY (id), | |
133 | - CONSTRAINT fk_jauysdajqskx8uho6dmqnjusc FOREIGN KEY (entrada_id) | |
134 | - REFERENCES entradaalmoxarifado (id) MATCH SIMPLE | |
135 | - ON UPDATE NO ACTION ON DELETE NO ACTION, | |
136 | - CONSTRAINT fk_la1r4gn1ut6fidop3mn8ob73s FOREIGN KEY (entradainativo_id) | |
137 | - REFERENCES entradaalmoxarifado (id) MATCH SIMPLE | |
138 | - ON UPDATE NO ACTION ON DELETE NO ACTION, | |
139 | - CONSTRAINT fk_n820n2hkd3sx0d06xf57lx5ne FOREIGN KEY (id) | |
140 | - REFERENCES documento (id) MATCH SIMPLE | |
141 | - ON UPDATE NO ACTION ON DELETE NO ACTION | |
142 | -); | |
143 | - | |
144 | -CREATE TABLE entradaalmoxarifadoobservacao | |
145 | -( | |
146 | - id bigint NOT NULL, | |
147 | - entrada_id bigint NOT NULL, | |
148 | - CONSTRAINT entradaalmobservacao_pkey PRIMARY KEY (id), | |
149 | - CONSTRAINT fk_3q3aa7nq2womlcwlv0x17e6jr FOREIGN KEY (entrada_id) | |
150 | - REFERENCES entradaalmoxarifado (id) MATCH SIMPLE | |
151 | - ON UPDATE NO ACTION ON DELETE NO ACTION, | |
152 | - CONSTRAINT fk_pca3puip81y7283w6v3cfi5 FOREIGN KEY (id) | |
153 | - REFERENCES observacao (id) MATCH SIMPLE | |
154 | - ON UPDATE NO ACTION ON DELETE NO ACTION | |
155 | -); | |
156 | - | |
157 | -INSERT INTO entradaalmoxarifadodocumento | |
158 | - SELECT id, entrada_id, entradainativo_id | |
159 | - FROM entradadocumento | |
160 | - WHERE entrada_id IN (SELECT id FROM entradaalmoxarifado) OR entradainativo_id IN (SELECT id FROM entradaalmoxarifado); | |
161 | - | |
162 | -INSERT INTO entradaalmoxarifadoobservacao | |
163 | - SELECT id, entrada_id | |
164 | - FROM entradaobservacao | |
165 | - WHERE entrada_id IN (SELECT id FROM entradaalmoxarifado); | |
166 | - | |
167 | -INSERT INTO dominio(id, datacriacao, dataedicao, version, chave, codigo, descricao, ispadrao, nome) | |
168 | - VALUES (NEXTVAL('hibernate_sequence'), LOCALTIMESTAMP, LOCALTIMESTAMP, 0, 'classeReferencia', 15, 'Entrada de materiais (Almoxarifado)', FALSE, 'ENTRADA_ALMOXARIFADO'); | |
169 | - | |
170 | -UPDATE | |
171 | - contacontabilmovimento | |
172 | -SET | |
173 | - dominioclassereferencia_id = (SELECT id FROM dominio WHERE chave = 'classeReferencia' AND codigo = 15), | |
174 | - idclassereferencia = ent.id, | |
175 | - entrada_id = null | |
176 | -FROM | |
177 | - (SELECT * FROM entradaalmoxarifado) ent | |
178 | -WHERE | |
179 | - ent.id = contacontabilmovimento.entrada_id AND contacontabilmovimento.idclassereferencia IS NULL; | |
180 | - | |
181 | -ALTER TABLE entradaalmoxarifado_aud | |
182 | - DROP CONSTRAINT fk_7eeoub6sej6yoekojkf98uku7; | |
183 | - | |
184 | -DELETE FROM entradaobservacao WHERE id IN (SELECT id FROM entradaalmoxarifadoobservacao); | |
185 | -DELETE FROM entradadocumento WHERE id IN (SELECT id FROM entradaalmoxarifadodocumento); | |
186 | -DELETE FROM entrada_aud WHERE id IN (SELECT id FROM entradaalmoxarifado_aud); | |
187 | -DELETE FROM entrada WHERE id IN (SELECT id FROM entradaalmoxarifado); | |
188 | - | |
189 | -CREATE TABLE entradaalmoxarifadodocumento_aud | |
190 | -( | |
191 | - id bigint NOT NULL, | |
192 | - rev integer NOT NULL, | |
193 | - entrada_id bigint, | |
194 | - entradainativo_id bigint, | |
195 | - CONSTRAINT entradaalmdocumento_aud_pkey PRIMARY KEY (id, rev), | |
196 | - CONSTRAINT fk_4ax607hoaw3vkoukieqx9t1uq FOREIGN KEY (id, rev) | |
197 | - REFERENCES documento_aud (id, rev) MATCH SIMPLE | |
198 | - ON UPDATE NO ACTION ON DELETE NO ACTION | |
199 | -); | |
200 | - | |
201 | --- GEOVANE FIM 27/04/2016 | |
202 | 0 | \ No newline at end of file |
cit-adm-materiais-api/src/main/resources/scripts-bd/postgres/v1.15.0/01-cit-adm-materiais-v1.15.0-postgres.sql
0 → 100644
... | ... | @@ -0,0 +1,1443 @@ |
1 | +-- GEOVANE INICIO 03/05/2016 | |
2 | + | |
3 | +DROP TABLE movimentoestoque; | |
4 | +DROP TABLE materialestoquesaldo; | |
5 | +DROP TABLE materialpermanenteconsumo; | |
6 | +DROP TABLE matpermancons_aud; | |
7 | +DROP TABLE atendimentoreqconsumoitem; | |
8 | +DROP TABLE atendimentorequisicaoconsumo; | |
9 | +DROP TABLE baixaalmoxarifadoitem; | |
10 | +DROP TABLE baixaalmoxarifado; | |
11 | +DROP TABLE baixaalmoxarifado_aud; | |
12 | +DROP TABLE bemalmoxarifadocaracteristica; | |
13 | +DROP TABLE bemalmoxcaract_aud; | |
14 | +DROP TABLE catalogomaterialitem; | |
15 | +DROP TABLE catmaterialunidadeconsreqitem; | |
16 | +DROP TABLE catalogomaterial; | |
17 | +DROP TABLE confignotificacaoressupgrupo; | |
18 | +DROP TABLE confignotificacaoressupusuario; | |
19 | +DROP TABLE confignotificacaoressuprimento; | |
20 | +DROP TABLE devolucaodocumento; | |
21 | +DROP TABLE devolucaoitem; | |
22 | +DROP TABLE devolucaoobservacao; | |
23 | +DROP TABLE devolucao; | |
24 | +DROP TABLE localestoque; | |
25 | +DROP TABLE entradaalmoxarifadoitem; | |
26 | +DROP TABLE entradaalmoxarifadoitem_aud; | |
27 | +DROP TABLE entradaalmoxarifado; | |
28 | +DROP TABLE entradaalmoxarifado_aud; | |
29 | +DROP TABLE estruturaorganizacionalalmox; | |
30 | +DROP TABLE requisicaoconsumoitem; | |
31 | +DROP TABLE requisicaoobservacao; | |
32 | +DROP TABLE requisicaoconsumo; | |
33 | +DROP TABLE matconsumotipounidadeentrada; | |
34 | +DROP TABLE matconstpunentrada_aud; | |
35 | +DROP TABLE materialconsumo; | |
36 | +DROP TABLE materialconsumo_aud; | |
37 | +DROP TABLE materialestoquesaldomedio; | |
38 | + | |
39 | +-- GEOVANE FIM 03/05/2016 | |
40 | + | |
41 | +-- GEOVANE INICIO 04/05/2016 | |
42 | + | |
43 | +CREATE TABLE alm_entrada | |
44 | +( | |
45 | + id bigint NOT NULL, | |
46 | + databloqueio date, | |
47 | + datainativo date, | |
48 | + datacriacao timestamp without time zone NOT NULL, | |
49 | + dataedicao timestamp without time zone NOT NULL, | |
50 | + version bigint, | |
51 | + codigo character varying(30), | |
52 | + codigoasi character varying(30), | |
53 | + datacontabil timestamp without time zone, | |
54 | + datarecebimento timestamp without time zone, | |
55 | + datareferencia timestamp without time zone NOT NULL, | |
56 | + iscontabilizada boolean, | |
57 | + isentradaconcluida boolean, | |
58 | + notarecebimento character varying(30), | |
59 | + valortotalnota numeric(20,2), | |
60 | + inativador_id bigint, | |
61 | + autor_id bigint, | |
62 | + editor_id bigint, | |
63 | + organizacao_id bigint, | |
64 | + almoxarifado_id bigint NOT NULL, | |
65 | + dominiofinalidade_id bigint NOT NULL, | |
66 | + dominiotipoentrada_id bigint NOT NULL, | |
67 | + dominiotiporecebimento_id bigint NOT NULL, | |
68 | + fornecedor_id bigint NOT NULL, | |
69 | + unidaderequisitante_id bigint, | |
70 | + CONSTRAINT alm_entrada_pkey PRIMARY KEY (id), | |
71 | + CONSTRAINT fk_1xygnb9br1ecqq6s6o0kxrh2b FOREIGN KEY (autor_id) | |
72 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
73 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
74 | + CONSTRAINT fk_38pxy1g1lvmp75l7t5q89xct9 FOREIGN KEY (fornecedor_id) | |
75 | + REFERENCES parceiro (id) MATCH SIMPLE | |
76 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
77 | + CONSTRAINT fk_3om2l7txfuhrmx9x0gjpqqkrt FOREIGN KEY (organizacao_id) | |
78 | + REFERENCES organizacao (id) MATCH SIMPLE | |
79 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
80 | + CONSTRAINT fk_brn5q96f4hisac0125u7dohkb FOREIGN KEY (inativador_id) | |
81 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
82 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
83 | + CONSTRAINT fk_gh15cehetkf5hhevjhwxf8the FOREIGN KEY (dominiotipoentrada_id) | |
84 | + REFERENCES dominio (id) MATCH SIMPLE | |
85 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
86 | + CONSTRAINT fk_ho50jimfjlhdyitgeatjn7vbq FOREIGN KEY (dominiofinalidade_id) | |
87 | + REFERENCES dominio (id) MATCH SIMPLE | |
88 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
89 | + CONSTRAINT fk_ijnhgxj6ypv2vw0v7dnunhdmn FOREIGN KEY (editor_id) | |
90 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
91 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
92 | + CONSTRAINT fk_je6bgbo1bdcqjsmi063lwwnke FOREIGN KEY (dominiotiporecebimento_id) | |
93 | + REFERENCES dominio (id) MATCH SIMPLE | |
94 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
95 | + CONSTRAINT fk_lk0uf0t7k7x4jjayurj2dsjpn FOREIGN KEY (almoxarifado_id) | |
96 | + REFERENCES estruturaorganizacional (id) MATCH SIMPLE | |
97 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
98 | + CONSTRAINT fk_r86yecl4llcsqej7tpu16wutp FOREIGN KEY (unidaderequisitante_id) | |
99 | + REFERENCES estruturaorganizacional (id) MATCH SIMPLE | |
100 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
101 | +); | |
102 | + | |
103 | +CREATE TABLE alm_entrada_aud | |
104 | +( | |
105 | + id bigint NOT NULL, | |
106 | + rev integer NOT NULL, | |
107 | + revtype smallint, | |
108 | + databloqueio date, | |
109 | + datainativo date, | |
110 | + datacriacao timestamp without time zone, | |
111 | + dataedicao timestamp without time zone, | |
112 | + codigo character varying(30), | |
113 | + codigoasi character varying(30), | |
114 | + datacontabil timestamp without time zone, | |
115 | + datarecebimento timestamp without time zone, | |
116 | + datareferencia timestamp without time zone, | |
117 | + iscontabilizada boolean, | |
118 | + isentradaconcluida boolean, | |
119 | + notarecebimento character varying(30), | |
120 | + valortotalnota numeric(20,2), | |
121 | + autor_id bigint, | |
122 | + editor_id bigint, | |
123 | + almoxarifado_id bigint, | |
124 | + dominiofinalidade_id bigint, | |
125 | + dominiotipoentrada_id bigint, | |
126 | + dominiotiporecebimento_id bigint, | |
127 | + unidaderequisitante_id bigint, | |
128 | + CONSTRAINT alm_entrada_aud_pkey PRIMARY KEY (id, rev) | |
129 | +); | |
130 | + | |
131 | +CREATE TABLE alm_en_documento | |
132 | +( | |
133 | + id bigint NOT NULL, | |
134 | + entrada_id bigint, | |
135 | + entradainativo_id bigint, | |
136 | + CONSTRAINT alm_en_documento_pkey PRIMARY KEY (id), | |
137 | + CONSTRAINT fk_8fru5v03lyhh1vwyvlmov1bxy FOREIGN KEY (entrada_id) | |
138 | + REFERENCES alm_entrada (id) MATCH SIMPLE | |
139 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
140 | + CONSTRAINT fk_j00m6e8exawjgnu94fnpul4dd FOREIGN KEY (entradainativo_id) | |
141 | + REFERENCES alm_entrada (id) MATCH SIMPLE | |
142 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
143 | + CONSTRAINT fk_mr2s56cixxm14rusoc1y2fvhx FOREIGN KEY (id) | |
144 | + REFERENCES documento (id) MATCH SIMPLE | |
145 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
146 | +); | |
147 | + | |
148 | +CREATE TABLE alm_en_documento_aud | |
149 | +( | |
150 | + id bigint NOT NULL, | |
151 | + rev integer NOT NULL, | |
152 | + entrada_id bigint, | |
153 | + entradainativo_id bigint, | |
154 | + CONSTRAINT alm_en_documento_aud_pkey PRIMARY KEY (id, rev), | |
155 | + CONSTRAINT fk_3212ajd7yw50pajor8ka9h52j FOREIGN KEY (id, rev) | |
156 | + REFERENCES documento_aud (id, rev) MATCH SIMPLE | |
157 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
158 | +); | |
159 | + | |
160 | +CREATE TABLE alm_en_observacao | |
161 | +( | |
162 | + id bigint NOT NULL, | |
163 | + entrada_id bigint NOT NULL, | |
164 | + CONSTRAINT alm_en_observacao_pkey PRIMARY KEY (id), | |
165 | + CONSTRAINT fk_9dk6k1lcoebg1bpfh3n1tw0cj FOREIGN KEY (entrada_id) | |
166 | + REFERENCES alm_entrada (id) MATCH SIMPLE | |
167 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
168 | + CONSTRAINT fk_r89ae877jbrenwo0c9s1gv83n FOREIGN KEY (id) | |
169 | + REFERENCES observacao (id) MATCH SIMPLE | |
170 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
171 | +); | |
172 | + | |
173 | +CREATE TABLE alm_estoque | |
174 | +( | |
175 | + id bigint NOT NULL, | |
176 | + databloqueio date, | |
177 | + datainativo date, | |
178 | + datacriacao timestamp without time zone NOT NULL, | |
179 | + dataedicao timestamp without time zone NOT NULL, | |
180 | + version bigint, | |
181 | + inativador_id bigint, | |
182 | + autor_id bigint, | |
183 | + editor_id bigint, | |
184 | + organizacao_id bigint, | |
185 | + almoxarifado_id bigint NOT NULL, | |
186 | + CONSTRAINT alm_estoque_pkey PRIMARY KEY (id), | |
187 | + CONSTRAINT fk_1cljoqca3xplogdvv46oa9kax FOREIGN KEY (autor_id) | |
188 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
189 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
190 | + CONSTRAINT fk_2s26akyafrcm2sctj0klh94h4 FOREIGN KEY (editor_id) | |
191 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
192 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
193 | + CONSTRAINT fk_7v1dej078tr18555baf3e9n54 FOREIGN KEY (inativador_id) | |
194 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
195 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
196 | + CONSTRAINT fk_hgv7qtgwqcd7nnkyxg3e5yws6 FOREIGN KEY (almoxarifado_id) | |
197 | + REFERENCES estruturaorganizacional (id) MATCH SIMPLE | |
198 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
199 | + CONSTRAINT fk_mcf55ysgw173k86e686tbgx6n FOREIGN KEY (organizacao_id) | |
200 | + REFERENCES organizacao (id) MATCH SIMPLE | |
201 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
202 | + CONSTRAINT uk_hgv7qtgwqcd7nnkyxg3e5yws6 UNIQUE (almoxarifado_id) | |
203 | +); | |
204 | + | |
205 | +CREATE TABLE alm_estoque_aud | |
206 | +( | |
207 | + id bigint NOT NULL, | |
208 | + rev integer NOT NULL, | |
209 | + revtype smallint, | |
210 | + databloqueio date, | |
211 | + datainativo date, | |
212 | + datacriacao timestamp without time zone, | |
213 | + dataedicao timestamp without time zone, | |
214 | + autor_id bigint, | |
215 | + editor_id bigint, | |
216 | + almoxarifado_id bigint, | |
217 | + CONSTRAINT alm_estoque_aud_pkey PRIMARY KEY (id, rev) | |
218 | +); | |
219 | + | |
220 | +CREATE TABLE alm_es_enderecoestoque | |
221 | +( | |
222 | + id bigint NOT NULL, | |
223 | + databloqueio date, | |
224 | + datainativo date, | |
225 | + datacriacao timestamp without time zone NOT NULL, | |
226 | + dataedicao timestamp without time zone NOT NULL, | |
227 | + version bigint, | |
228 | + inativador_id bigint, | |
229 | + autor_id bigint, | |
230 | + editor_id bigint, | |
231 | + organizacao_id bigint, | |
232 | + estoque_id bigint, | |
233 | + estoqueinativo_id bigint, | |
234 | + CONSTRAINT alm_es_enderecoestoque_pkey PRIMARY KEY (id), | |
235 | + CONSTRAINT fk_7cque00jpsdib3vrm26xkusdd FOREIGN KEY (inativador_id) | |
236 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
237 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
238 | + CONSTRAINT fk_7ndaljqilpb1onj3i47ay28vr FOREIGN KEY (autor_id) | |
239 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
240 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
241 | + CONSTRAINT fk_b8va70srt4c9cyd2r3flqy3ts FOREIGN KEY (estoqueinativo_id) | |
242 | + REFERENCES alm_estoque (id) MATCH SIMPLE | |
243 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
244 | + CONSTRAINT fk_lun8xpext1c1biblsrjhxhiip FOREIGN KEY (estoque_id) | |
245 | + REFERENCES alm_estoque (id) MATCH SIMPLE | |
246 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
247 | + CONSTRAINT fk_mj0n25iy613xq928u7u31jjvk FOREIGN KEY (editor_id) | |
248 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
249 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
250 | + CONSTRAINT fk_npvxsokt3fcl4rl1v3ik2ky2k FOREIGN KEY (organizacao_id) | |
251 | + REFERENCES organizacao (id) MATCH SIMPLE | |
252 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
253 | +); | |
254 | + | |
255 | +CREATE TABLE alm_es_enderecoestoque_aud | |
256 | +( | |
257 | + id bigint NOT NULL, | |
258 | + rev integer NOT NULL, | |
259 | + revtype smallint, | |
260 | + databloqueio date, | |
261 | + datainativo date, | |
262 | + datacriacao timestamp without time zone, | |
263 | + dataedicao timestamp without time zone, | |
264 | + autor_id bigint, | |
265 | + editor_id bigint, | |
266 | + estoque_id bigint, | |
267 | + estoqueinativo_id bigint, | |
268 | + CONSTRAINT alm_es_enderecoestoque_aud_pkey PRIMARY KEY (id, rev) | |
269 | +); | |
270 | + | |
271 | +CREATE TABLE alm_materialconsumo | |
272 | +( | |
273 | + elementodespesa character varying(255), | |
274 | + id bigint NOT NULL, | |
275 | + unidadearmazenamento_id bigint NOT NULL, | |
276 | + CONSTRAINT alm_materialconsumo_pkey PRIMARY KEY (id), | |
277 | + CONSTRAINT fk_ng0jkg3o090umwff3jeio9jdf FOREIGN KEY (unidadearmazenamento_id) | |
278 | + REFERENCES unidademedida (id) MATCH SIMPLE | |
279 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
280 | + CONSTRAINT fk_nv4tvt10k4j217w2v3uc7v9cv FOREIGN KEY (id) | |
281 | + REFERENCES material (id) MATCH SIMPLE | |
282 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
283 | +); | |
284 | + | |
285 | +CREATE TABLE alm_materialconsumo_aud | |
286 | +( | |
287 | + id bigint NOT NULL, | |
288 | + rev integer NOT NULL, | |
289 | + elementodespesa character varying(255), | |
290 | + unidadearmazenamento_id bigint, | |
291 | + CONSTRAINT alm_materialconsumo_aud_pkey PRIMARY KEY (id, rev), | |
292 | + CONSTRAINT fk_4tpas7nd065uq1w936621s597 FOREIGN KEY (id, rev) | |
293 | + REFERENCES material_aud (id, rev) MATCH SIMPLE | |
294 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
295 | +); | |
296 | + | |
297 | +CREATE TABLE alm_materialestoque | |
298 | +( | |
299 | + id bigint NOT NULL, | |
300 | + databloqueio date, | |
301 | + datainativo date, | |
302 | + datacriacao timestamp without time zone NOT NULL, | |
303 | + dataedicao timestamp without time zone NOT NULL, | |
304 | + version bigint, | |
305 | + restomedio numeric(20,4), | |
306 | + valorunitariomedio numeric(20,4), | |
307 | + inativador_id bigint, | |
308 | + autor_id bigint, | |
309 | + editor_id bigint, | |
310 | + organizacao_id bigint, | |
311 | + material_id bigint NOT NULL, | |
312 | + CONSTRAINT alm_materialestoque_pkey PRIMARY KEY (id), | |
313 | + CONSTRAINT fk_8uu05hib97ph5fx849uneyb1x FOREIGN KEY (organizacao_id) | |
314 | + REFERENCES organizacao (id) MATCH SIMPLE | |
315 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
316 | + CONSTRAINT fk_dmmv4h2uxjke1xmcaaq0cxpbe FOREIGN KEY (material_id) | |
317 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
318 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
319 | + CONSTRAINT fk_m6nafjqbl1qve5m6w19namkev FOREIGN KEY (inativador_id) | |
320 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
321 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
322 | + CONSTRAINT fk_n9vlft46032ua66eao1iy1i6k FOREIGN KEY (autor_id) | |
323 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
324 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
325 | + CONSTRAINT fk_nhxlxgb6h6c3m1okq1vohfge FOREIGN KEY (editor_id) | |
326 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
327 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
328 | + CONSTRAINT uk_dmmv4h2uxjke1xmcaaq0cxpbe UNIQUE (material_id) | |
329 | +); | |
330 | + | |
331 | +CREATE TABLE alm_materialestoque_aud | |
332 | +( | |
333 | + id bigint NOT NULL, | |
334 | + rev integer NOT NULL, | |
335 | + revtype smallint, | |
336 | + databloqueio date, | |
337 | + datainativo date, | |
338 | + datacriacao timestamp without time zone, | |
339 | + dataedicao timestamp without time zone, | |
340 | + restomedio numeric(20,4), | |
341 | + valorunitariomedio numeric(20,4), | |
342 | + autor_id bigint, | |
343 | + editor_id bigint, | |
344 | + material_id bigint, | |
345 | + CONSTRAINT alm_materialestoque_aud_pkey PRIMARY KEY (id, rev) | |
346 | +); | |
347 | + | |
348 | +CREATE TABLE alm_me_localestoque | |
349 | +( | |
350 | + id bigint NOT NULL, | |
351 | + databloqueio date, | |
352 | + datainativo date, | |
353 | + datacriacao timestamp without time zone NOT NULL, | |
354 | + dataedicao timestamp without time zone NOT NULL, | |
355 | + version bigint, | |
356 | + quantidade numeric(19,2), | |
357 | + inativador_id bigint, | |
358 | + autor_id bigint, | |
359 | + editor_id bigint, | |
360 | + organizacao_id bigint, | |
361 | + endereco_id bigint NOT NULL, | |
362 | + enderecoinativo_id bigint, | |
363 | + materialestoque_id bigint NOT NULL, | |
364 | + materialestoqueinativo_id bigint, | |
365 | + unidademedidaentrada_id bigint NOT NULL, | |
366 | + CONSTRAINT alm_me_localestoque_pkey PRIMARY KEY (id), | |
367 | + CONSTRAINT fk_438teo7y89v821sfi61hm127g FOREIGN KEY (unidademedidaentrada_id) | |
368 | + REFERENCES unidademedida (id) MATCH SIMPLE | |
369 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
370 | + CONSTRAINT fk_edahikxmns0vs1pnoa6ovod82 FOREIGN KEY (materialestoqueinativo_id) | |
371 | + REFERENCES alm_materialestoque (id) MATCH SIMPLE | |
372 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
373 | + CONSTRAINT fk_foifpbnon1jfcybg9dlsro9c FOREIGN KEY (editor_id) | |
374 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
375 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
376 | + CONSTRAINT fk_i4iuf17nxlo7t9v26ejvlr6ud FOREIGN KEY (enderecoinativo_id) | |
377 | + REFERENCES alm_es_enderecoestoque (id) MATCH SIMPLE | |
378 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
379 | + CONSTRAINT fk_jsrcjmbvm7pnw3ql1hoiyhamj FOREIGN KEY (materialestoque_id) | |
380 | + REFERENCES alm_materialestoque (id) MATCH SIMPLE | |
381 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
382 | + CONSTRAINT fk_owi6smnhuil706bc0ahndgo89 FOREIGN KEY (organizacao_id) | |
383 | + REFERENCES organizacao (id) MATCH SIMPLE | |
384 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
385 | + CONSTRAINT fk_qm5wppxgajf0asko3ov9ykn07 FOREIGN KEY (autor_id) | |
386 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
387 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
388 | + CONSTRAINT fk_qnx0r3sv9yxte5bholpq15k4p FOREIGN KEY (endereco_id) | |
389 | + REFERENCES alm_es_enderecoestoque (id) MATCH SIMPLE | |
390 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
391 | + CONSTRAINT fk_rqrp8dor6nqoh91p9bv9u9yyi FOREIGN KEY (inativador_id) | |
392 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
393 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
394 | + CONSTRAINT uk_jsrcjmbvm7pnw3ql1hoiyhamj UNIQUE (materialestoque_id), | |
395 | + CONSTRAINT uk_qnx0r3sv9yxte5bholpq15k4p UNIQUE (endereco_id) | |
396 | +); | |
397 | + | |
398 | +CREATE TABLE alm_me_localestoque_aud | |
399 | +( | |
400 | + id bigint NOT NULL, | |
401 | + rev integer NOT NULL, | |
402 | + revtype smallint, | |
403 | + databloqueio date, | |
404 | + datainativo date, | |
405 | + datacriacao timestamp without time zone, | |
406 | + dataedicao timestamp without time zone, | |
407 | + quantidade numeric(19,2), | |
408 | + autor_id bigint, | |
409 | + editor_id bigint, | |
410 | + endereco_id bigint, | |
411 | + enderecoinativo_id bigint, | |
412 | + materialestoque_id bigint, | |
413 | + materialestoqueinativo_id bigint, | |
414 | + unidademedidaentrada_id bigint, | |
415 | + CONSTRAINT alm_me_localestoque_aud_pkey PRIMARY KEY (id, rev) | |
416 | +); | |
417 | + | |
418 | +CREATE TABLE alm_me_fifoitem | |
419 | +( | |
420 | + id bigint NOT NULL, | |
421 | + databloqueio date, | |
422 | + datainativo date, | |
423 | + datacriacao timestamp without time zone NOT NULL, | |
424 | + dataedicao timestamp without time zone NOT NULL, | |
425 | + version bigint, | |
426 | + quantidadeinicial numeric(20,4) NOT NULL, | |
427 | + quantidaderestante numeric(20,4) NOT NULL, | |
428 | + valorsobra numeric(20,4) NOT NULL, | |
429 | + valortotal numeric(20,4) NOT NULL, | |
430 | + valorunitario numeric(20,4) NOT NULL, | |
431 | + inativador_id bigint, | |
432 | + autor_id bigint, | |
433 | + editor_id bigint, | |
434 | + organizacao_id bigint, | |
435 | + material_id bigint NOT NULL, | |
436 | + materialestoque_id bigint, | |
437 | + materialestoqueinativo_id bigint, | |
438 | + CONSTRAINT alm_me_fifoitem_pkey PRIMARY KEY (id), | |
439 | + CONSTRAINT fk_22i3rv27hwchu5hqbcua33dj4 FOREIGN KEY (editor_id) | |
440 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
441 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
442 | + CONSTRAINT fk_3pa241s7brr43ml1kgvlrb9e8 FOREIGN KEY (material_id) | |
443 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
444 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
445 | + CONSTRAINT fk_c1aff1rb22jk8rxfyjw2ahp6p FOREIGN KEY (materialestoque_id) | |
446 | + REFERENCES alm_materialestoque (id) MATCH SIMPLE | |
447 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
448 | + CONSTRAINT fk_dr3ga3srn18drk0qykl00mr5 FOREIGN KEY (inativador_id) | |
449 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
450 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
451 | + CONSTRAINT fk_k80jc3a46c8i36hhbppqy2t7i FOREIGN KEY (materialestoqueinativo_id) | |
452 | + REFERENCES alm_materialestoque (id) MATCH SIMPLE | |
453 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
454 | + CONSTRAINT fk_mc0i03d1p7s6ney7y1hnwulbo FOREIGN KEY (organizacao_id) | |
455 | + REFERENCES organizacao (id) MATCH SIMPLE | |
456 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
457 | + CONSTRAINT fk_t03lnpymhj4fxcvtwg3rs1st9 FOREIGN KEY (autor_id) | |
458 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
459 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
460 | + CONSTRAINT uk_3pa241s7brr43ml1kgvlrb9e8 UNIQUE (material_id) | |
461 | +); | |
462 | + | |
463 | +CREATE TABLE alm_me_fifoitem_aud | |
464 | +( | |
465 | + id bigint NOT NULL, | |
466 | + rev integer NOT NULL, | |
467 | + revtype smallint, | |
468 | + databloqueio date, | |
469 | + datainativo date, | |
470 | + datacriacao timestamp without time zone, | |
471 | + dataedicao timestamp without time zone, | |
472 | + quantidadeinicial numeric(20,4), | |
473 | + quantidaderestante numeric(20,4), | |
474 | + valorsobra numeric(20,4), | |
475 | + valortotal numeric(20,4), | |
476 | + valorunitario numeric(20,4), | |
477 | + autor_id bigint, | |
478 | + editor_id bigint, | |
479 | + material_id bigint, | |
480 | + materialestoque_id bigint, | |
481 | + materialestoqueinativo_id bigint, | |
482 | + CONSTRAINT alm_me_fifoitem_aud_pkey PRIMARY KEY (id, rev) | |
483 | +); | |
484 | + | |
485 | +CREATE TABLE alm_me_movimentoestoque | |
486 | +( | |
487 | + id bigint NOT NULL, | |
488 | + databloqueio date, | |
489 | + datainativo date, | |
490 | + datacriacao timestamp without time zone NOT NULL, | |
491 | + dataedicao timestamp without time zone NOT NULL, | |
492 | + version bigint, | |
493 | + datamovimento timestamp without time zone NOT NULL, | |
494 | + idclassereferencia bigint, | |
495 | + quantidade numeric(19,2), | |
496 | + valorfifo numeric(20,4), | |
497 | + valormedia numeric(20,4), | |
498 | + inativador_id bigint, | |
499 | + autor_id bigint, | |
500 | + editor_id bigint, | |
501 | + organizacao_id bigint, | |
502 | + dominioclassereferencia_id bigint, | |
503 | + material_id bigint NOT NULL, | |
504 | + materialestoque_id bigint, | |
505 | + materiallocalestoque_id bigint, | |
506 | + tipomovimento_id bigint NOT NULL, | |
507 | + CONSTRAINT alm_me_movimentoestoque_pkey PRIMARY KEY (id), | |
508 | + CONSTRAINT fk_2i23htrrm31ummfpwt5sf2bm9 FOREIGN KEY (autor_id) | |
509 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
510 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
511 | + CONSTRAINT fk_5c9filnq6hohatk9hgl4jv4gc FOREIGN KEY (organizacao_id) | |
512 | + REFERENCES organizacao (id) MATCH SIMPLE | |
513 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
514 | + CONSTRAINT fk_5vrvdeo94atx7eryndteynymr FOREIGN KEY (editor_id) | |
515 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
516 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
517 | + CONSTRAINT fk_aqnd3i2nqi2k6jty7k5jpa1v8 FOREIGN KEY (materialestoque_id) | |
518 | + REFERENCES alm_materialestoque (id) MATCH SIMPLE | |
519 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
520 | + CONSTRAINT fk_kaop9f8yojum5yn743s9ckyw9 FOREIGN KEY (materiallocalestoque_id) | |
521 | + REFERENCES alm_me_localestoque (id) MATCH SIMPLE | |
522 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
523 | + CONSTRAINT fk_npkk25ix0nqw69q74rm5fiiqu FOREIGN KEY (material_id) | |
524 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
525 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
526 | + CONSTRAINT fk_o29xdmxcha63gb8re1m4htq1g FOREIGN KEY (inativador_id) | |
527 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
528 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
529 | + CONSTRAINT fk_piofgnndttb0j8y2akpotqgfv FOREIGN KEY (dominioclassereferencia_id) | |
530 | + REFERENCES dominio (id) MATCH SIMPLE | |
531 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
532 | + CONSTRAINT fk_sa7jtn7qy3my47jm1tglcdkh0 FOREIGN KEY (tipomovimento_id) | |
533 | + REFERENCES dominio (id) MATCH SIMPLE | |
534 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
535 | +); | |
536 | + | |
537 | +CREATE TABLE alm_me_movimentoestoque_aud | |
538 | +( | |
539 | + id bigint NOT NULL, | |
540 | + rev integer NOT NULL, | |
541 | + revtype smallint, | |
542 | + databloqueio date, | |
543 | + datainativo date, | |
544 | + datacriacao timestamp without time zone, | |
545 | + dataedicao timestamp without time zone, | |
546 | + datamovimento timestamp without time zone, | |
547 | + idclassereferencia bigint, | |
548 | + quantidade numeric(19,2), | |
549 | + valorfifo numeric(20,4), | |
550 | + valormedia numeric(20,4), | |
551 | + autor_id bigint, | |
552 | + editor_id bigint, | |
553 | + dominioclassereferencia_id bigint, | |
554 | + material_id bigint, | |
555 | + materialestoque_id bigint, | |
556 | + materiallocalestoque_id bigint, | |
557 | + tipomovimento_id bigint, | |
558 | + CONSTRAINT alm_me_movimentoestoque_aud_pkey PRIMARY KEY (id, rev) | |
559 | +); | |
560 | + | |
561 | +CREATE TABLE alm_me_saldo | |
562 | +( | |
563 | + id bigint NOT NULL, | |
564 | + databloqueio date, | |
565 | + datainativo date, | |
566 | + datacriacao timestamp without time zone NOT NULL, | |
567 | + dataedicao timestamp without time zone NOT NULL, | |
568 | + version bigint, | |
569 | + datareferencia timestamp without time zone, | |
570 | + quantidade numeric(19,2), | |
571 | + valorfechado numeric(20,4), | |
572 | + inativador_id bigint, | |
573 | + autor_id bigint, | |
574 | + editor_id bigint, | |
575 | + organizacao_id bigint, | |
576 | + localestoque_id bigint, | |
577 | + material_id bigint, | |
578 | + tipofechamento_id bigint, | |
579 | + unidademedidamaterial_id bigint, | |
580 | + CONSTRAINT alm_me_saldo_pkey PRIMARY KEY (id), | |
581 | + CONSTRAINT fk_589xlahkulrpqys29gclk6gni FOREIGN KEY (inativador_id) | |
582 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
583 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
584 | + CONSTRAINT fk_6g11acmoqci1mbj4a464l3v7 FOREIGN KEY (localestoque_id) | |
585 | + REFERENCES alm_me_localestoque (id) MATCH SIMPLE | |
586 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
587 | + CONSTRAINT fk_6gy8vmoy3wg8v7uhmqljoovqx FOREIGN KEY (editor_id) | |
588 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
589 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
590 | + CONSTRAINT fk_99mhx5drww5r99ykddu2tg7uc FOREIGN KEY (tipofechamento_id) | |
591 | + REFERENCES dominio (id) MATCH SIMPLE | |
592 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
593 | + CONSTRAINT fk_9jcyhumgfyuqoox02ug4sc431 FOREIGN KEY (unidademedidamaterial_id) | |
594 | + REFERENCES unidademedida (id) MATCH SIMPLE | |
595 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
596 | + CONSTRAINT fk_o6xycy6ped3gdsdcmchoyxl3y FOREIGN KEY (organizacao_id) | |
597 | + REFERENCES organizacao (id) MATCH SIMPLE | |
598 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
599 | + CONSTRAINT fk_p9a08mrh2jsn8d8hgn0y09iia FOREIGN KEY (autor_id) | |
600 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
601 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
602 | + CONSTRAINT fk_pvab6hxxw44jvhkjyx9smuv2o FOREIGN KEY (material_id) | |
603 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
604 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
605 | +); | |
606 | + | |
607 | +CREATE TABLE alm_not_ressuprimento | |
608 | +( | |
609 | + id bigint NOT NULL, | |
610 | + databloqueio date, | |
611 | + datainativo date, | |
612 | + datacriacao timestamp without time zone NOT NULL, | |
613 | + dataedicao timestamp without time zone NOT NULL, | |
614 | + version bigint, | |
615 | + cronexpression character varying(255), | |
616 | + identificador character varying(255), | |
617 | + limiteestoque numeric(20,2), | |
618 | + milissegundocron bigint, | |
619 | + pontopedido integer, | |
620 | + inativador_id bigint, | |
621 | + autor_id bigint, | |
622 | + editor_id bigint, | |
623 | + organizacao_id bigint, | |
624 | + localestoque_id bigint NOT NULL, | |
625 | + materialconsumo_id bigint, | |
626 | + notificacao_id bigint NOT NULL, | |
627 | + CONSTRAINT alm_not_ressuprimento_pkey PRIMARY KEY (id), | |
628 | + CONSTRAINT fk_c7rvw5oa5yiunkyuq6hyr92id FOREIGN KEY (inativador_id) | |
629 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
630 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
631 | + CONSTRAINT fk_dvgtfsqpa4w9326sekcwf8hjn FOREIGN KEY (organizacao_id) | |
632 | + REFERENCES organizacao (id) MATCH SIMPLE | |
633 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
634 | + CONSTRAINT fk_dyj3xdj44hb6pcijjt9ka6u1n FOREIGN KEY (localestoque_id) | |
635 | + REFERENCES alm_me_localestoque (id) MATCH SIMPLE | |
636 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
637 | + CONSTRAINT fk_hfj922mlbpwp69umqesvsi9bh FOREIGN KEY (editor_id) | |
638 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
639 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
640 | + CONSTRAINT fk_jpv4gpk8kypfb2apegmm0pkoi FOREIGN KEY (notificacao_id) | |
641 | + REFERENCES notificacao (id) MATCH SIMPLE | |
642 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
643 | + CONSTRAINT fk_kpxb1byqsspecea7o10xw4ay9 FOREIGN KEY (autor_id) | |
644 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
645 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
646 | + CONSTRAINT fk_n97xunao8nboa082dnfr07jbx FOREIGN KEY (materialconsumo_id) | |
647 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
648 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
649 | +); | |
650 | + | |
651 | +CREATE TABLE alm_en_entradaitem | |
652 | +( | |
653 | + id bigint NOT NULL, | |
654 | + databloqueio date, | |
655 | + datainativo date, | |
656 | + datacriacao timestamp without time zone NOT NULL, | |
657 | + dataedicao timestamp without time zone NOT NULL, | |
658 | + version bigint, | |
659 | + datavalidade timestamp without time zone, | |
660 | + numerolote character varying(255), | |
661 | + quantidade numeric(19,2), | |
662 | + valortotal numeric(20,4), | |
663 | + valorunitario numeric(20,4), | |
664 | + inativador_id bigint, | |
665 | + autor_id bigint, | |
666 | + editor_id bigint, | |
667 | + entrada_id bigint, | |
668 | + entradainativo_id bigint, | |
669 | + material_id bigint NOT NULL, | |
670 | + materiallocalestoque_id bigint NOT NULL, | |
671 | + unidademedidaentrada_id bigint NOT NULL, | |
672 | + CONSTRAINT alm_en_entradaitem_pkey PRIMARY KEY (id), | |
673 | + CONSTRAINT fk_51dvfphluspkpjev6p3brtmmw FOREIGN KEY (entrada_id) | |
674 | + REFERENCES alm_entrada (id) MATCH SIMPLE | |
675 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
676 | + CONSTRAINT fk_995rtumo5346s148w5q9qw8t6 FOREIGN KEY (inativador_id) | |
677 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
678 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
679 | + CONSTRAINT fk_ackxqpap8nt3qk6chb9onl4rj FOREIGN KEY (unidademedidaentrada_id) | |
680 | + REFERENCES unidademedida (id) MATCH SIMPLE | |
681 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
682 | + CONSTRAINT fk_ak8ldmlglxidulpw4e1qto3dp FOREIGN KEY (material_id) | |
683 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
684 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
685 | + CONSTRAINT fk_n3hepobqcqgjqno0hcanw5era FOREIGN KEY (autor_id) | |
686 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
687 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
688 | + CONSTRAINT fk_opbnhs743oeshvg2tt4frjk4y FOREIGN KEY (entradainativo_id) | |
689 | + REFERENCES alm_entrada (id) MATCH SIMPLE | |
690 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
691 | + CONSTRAINT fk_r2m81bt0elxvncf8su58px08j FOREIGN KEY (materiallocalestoque_id) | |
692 | + REFERENCES alm_me_localestoque (id) MATCH SIMPLE | |
693 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
694 | + CONSTRAINT fk_rkae7uj2vji4kwqvkga7b7ige FOREIGN KEY (editor_id) | |
695 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
696 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
697 | +); | |
698 | + | |
699 | +CREATE TABLE alm_en_entradaitem_aud | |
700 | +( | |
701 | + id bigint NOT NULL, | |
702 | + rev integer NOT NULL, | |
703 | + revtype smallint, | |
704 | + databloqueio date, | |
705 | + datainativo date, | |
706 | + datacriacao timestamp without time zone, | |
707 | + dataedicao timestamp without time zone, | |
708 | + datavalidade timestamp without time zone, | |
709 | + numerolote character varying(255), | |
710 | + quantidade numeric(19,2), | |
711 | + valortotal numeric(20,4), | |
712 | + valorunitario numeric(20,4), | |
713 | + autor_id bigint, | |
714 | + editor_id bigint, | |
715 | + entrada_id bigint, | |
716 | + entradainativo_id bigint, | |
717 | + material_id bigint, | |
718 | + materiallocalestoque_id bigint, | |
719 | + unidademedidaentrada_id bigint, | |
720 | + CONSTRAINT alm_en_entradaitem_aud_pkey PRIMARY KEY (id, rev) | |
721 | +); | |
722 | + | |
723 | + | |
724 | + | |
725 | + | |
726 | + | |
727 | +CREATE TABLE alm_baixa | |
728 | +( | |
729 | + databaixa timestamp without time zone NOT NULL, | |
730 | + numerobaixa character varying(30), | |
731 | + id bigint NOT NULL, | |
732 | + almoxarifado_id bigint NOT NULL, | |
733 | + destino_id bigint, | |
734 | + dominiosituacaoestorno_id bigint NOT NULL, | |
735 | + dominiotipobaixa_id bigint NOT NULL, | |
736 | + CONSTRAINT alm_baixa_pkey PRIMARY KEY (id), | |
737 | + CONSTRAINT fk_3d9f7d4vwqobat8qo6r8jjnea FOREIGN KEY (almoxarifado_id) | |
738 | + REFERENCES estruturaorganizacional (id) MATCH SIMPLE | |
739 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
740 | + CONSTRAINT fk_6e4oev8qcuespbgavxe3wm73n FOREIGN KEY (dominiotipobaixa_id) | |
741 | + REFERENCES dominio (id) MATCH SIMPLE | |
742 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
743 | + CONSTRAINT fk_dkscfqr5g3ve84gt3sqahekn1 FOREIGN KEY (destino_id) | |
744 | + REFERENCES parceiro (id) MATCH SIMPLE | |
745 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
746 | + CONSTRAINT fk_grdxvkfwjpi56v6ps2xo2xfdq FOREIGN KEY (dominiosituacaoestorno_id) | |
747 | + REFERENCES dominio (id) MATCH SIMPLE | |
748 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
749 | + CONSTRAINT fk_j9jove8gg2oc5ba6bmtwbauv4 FOREIGN KEY (id) | |
750 | + REFERENCES baixa (id) MATCH SIMPLE | |
751 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
752 | +); | |
753 | + | |
754 | +CREATE TABLE alm_baixa_aud | |
755 | +( | |
756 | + id bigint NOT NULL, | |
757 | + rev integer NOT NULL, | |
758 | + databaixa timestamp without time zone, | |
759 | + numerobaixa character varying(30), | |
760 | + almoxarifado_id bigint, | |
761 | + destino_id bigint, | |
762 | + dominiosituacaoestorno_id bigint, | |
763 | + dominiotipobaixa_id bigint, | |
764 | + CONSTRAINT alm_baixa_aud_pkey PRIMARY KEY (id, rev), | |
765 | + CONSTRAINT fk_5ccgyy8rem29kelqvt82o67kj FOREIGN KEY (id, rev) | |
766 | + REFERENCES baixa_aud (id, rev) MATCH SIMPLE | |
767 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
768 | +); | |
769 | + | |
770 | +CREATE TABLE alm_bem_caracteristica | |
771 | +( | |
772 | + id bigint NOT NULL, | |
773 | + databloqueio date, | |
774 | + datainativo date, | |
775 | + datacriacao timestamp without time zone NOT NULL, | |
776 | + dataedicao timestamp without time zone NOT NULL, | |
777 | + version bigint, | |
778 | + valorcaracteristica character varying(255), | |
779 | + inativador_id bigint, | |
780 | + autor_id bigint, | |
781 | + editor_id bigint, | |
782 | + organizacao_id bigint, | |
783 | + caracteristica_id bigint NOT NULL, | |
784 | + entradaitem_id bigint NOT NULL, | |
785 | + materialcaracteristica_id bigint NOT NULL, | |
786 | + CONSTRAINT alm_bem_caracteristica_pkey PRIMARY KEY (id), | |
787 | + CONSTRAINT fk_9nevva15x4pp5wxkcscw7ycv3 FOREIGN KEY (materialcaracteristica_id) | |
788 | + REFERENCES materialcaracteristica (id) MATCH SIMPLE | |
789 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
790 | + CONSTRAINT fk_9o2lc892ugxi43qpfy340kvuf FOREIGN KEY (organizacao_id) | |
791 | + REFERENCES organizacao (id) MATCH SIMPLE | |
792 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
793 | + CONSTRAINT fk_a7yyeopuhh47j3qbm0hjjlsjy FOREIGN KEY (autor_id) | |
794 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
795 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
796 | + CONSTRAINT fk_cyqjy0cn0837xb7ns870qkrtn FOREIGN KEY (editor_id) | |
797 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
798 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
799 | + CONSTRAINT fk_pe6990bdkscpphicmmgoj51sh FOREIGN KEY (entradaitem_id) | |
800 | + REFERENCES alm_en_entradaitem (id) MATCH SIMPLE | |
801 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
802 | + CONSTRAINT fk_q6g8lkp1krshkcd4uaeobmkwp FOREIGN KEY (caracteristica_id) | |
803 | + REFERENCES caracteristica (id) MATCH SIMPLE | |
804 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
805 | + CONSTRAINT fk_r7m2dwpb6g78wftnvox1h4m7r FOREIGN KEY (inativador_id) | |
806 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
807 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
808 | +); | |
809 | + | |
810 | +CREATE TABLE alm_bem_caracteristica_aud | |
811 | +( | |
812 | + id bigint NOT NULL, | |
813 | + rev integer NOT NULL, | |
814 | + revtype smallint, | |
815 | + databloqueio date, | |
816 | + datainativo date, | |
817 | + datacriacao timestamp without time zone, | |
818 | + dataedicao timestamp without time zone, | |
819 | + valorcaracteristica character varying(255), | |
820 | + autor_id bigint, | |
821 | + editor_id bigint, | |
822 | + caracteristica_id bigint, | |
823 | + entradaitem_id bigint, | |
824 | + materialcaracteristica_id bigint, | |
825 | + CONSTRAINT bemalmoxcaract_aud_pkey PRIMARY KEY (id, rev) | |
826 | +); | |
827 | + | |
828 | +CREATE TABLE alm_bx_item | |
829 | +( | |
830 | + id bigint NOT NULL, | |
831 | + databloqueio date, | |
832 | + datainativo date, | |
833 | + datacriacao timestamp without time zone NOT NULL, | |
834 | + dataedicao timestamp without time zone NOT NULL, | |
835 | + version bigint, | |
836 | + dataestorno timestamp without time zone, | |
837 | + quantidade numeric(20,4), | |
838 | + total numeric(20,4), | |
839 | + inativador_id bigint, | |
840 | + autor_id bigint, | |
841 | + editor_id bigint, | |
842 | + baixaalmoxarifado_id bigint, | |
843 | + baixaremocao_id bigint, | |
844 | + materialconsumo_id bigint, | |
845 | + CONSTRAINT alm_bx_item_pkey PRIMARY KEY (id), | |
846 | + CONSTRAINT fk_3xs5ark9djrpghnk3vf07whxg FOREIGN KEY (baixaalmoxarifado_id) | |
847 | + REFERENCES alm_baixa (id) MATCH SIMPLE | |
848 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
849 | + CONSTRAINT fk_43k9gp25kqh95gyl84hnq30h FOREIGN KEY (baixaremocao_id) | |
850 | + REFERENCES alm_baixa (id) MATCH SIMPLE | |
851 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
852 | + CONSTRAINT fk_4rak32nl2kradw0c3p24shf1h FOREIGN KEY (materialconsumo_id) | |
853 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
854 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
855 | + CONSTRAINT fk_c2x028qwptoypbiofjchc8tj9 FOREIGN KEY (inativador_id) | |
856 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
857 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
858 | + CONSTRAINT fk_d11fqh0tlvnrkgc2b6iei9mdl FOREIGN KEY (autor_id) | |
859 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
860 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
861 | + CONSTRAINT fk_hnvjoomhkyt6imnufbnj36egp FOREIGN KEY (editor_id) | |
862 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
863 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
864 | +); | |
865 | + | |
866 | +CREATE TABLE alm_catalogomaterial | |
867 | +( | |
868 | + id bigint NOT NULL, | |
869 | + databloqueio date, | |
870 | + datainativo date, | |
871 | + datacriacao timestamp without time zone NOT NULL, | |
872 | + dataedicao timestamp without time zone NOT NULL, | |
873 | + version bigint, | |
874 | + datafim timestamp without time zone, | |
875 | + datainicio timestamp without time zone, | |
876 | + nome character varying(255), | |
877 | + inativador_id bigint, | |
878 | + autor_id bigint, | |
879 | + editor_id bigint, | |
880 | + organizacao_id bigint, | |
881 | + CONSTRAINT alm_catalogomaterial_pkey PRIMARY KEY (id), | |
882 | + CONSTRAINT fk_2dhpq4fa38jam1bbvu37swmyn FOREIGN KEY (editor_id) | |
883 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
884 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
885 | + CONSTRAINT fk_8xum7fb3ob6gqgbmwmayq5cyv FOREIGN KEY (inativador_id) | |
886 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
887 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
888 | + CONSTRAINT fk_e8t6p872p7je4i4q38h9mv16a FOREIGN KEY (autor_id) | |
889 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
890 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
891 | + CONSTRAINT fk_hxf5rf6v640v3o8d457j7w7e7 FOREIGN KEY (organizacao_id) | |
892 | + REFERENCES organizacao (id) MATCH SIMPLE | |
893 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
894 | +); | |
895 | + | |
896 | +CREATE TABLE alm_cm_item | |
897 | +( | |
898 | + id bigint NOT NULL, | |
899 | + databloqueio date, | |
900 | + datainativo date, | |
901 | + datacriacao timestamp without time zone NOT NULL, | |
902 | + dataedicao timestamp without time zone NOT NULL, | |
903 | + version bigint, | |
904 | + inativador_id bigint, | |
905 | + autor_id bigint, | |
906 | + editor_id bigint, | |
907 | + organizacao_id bigint, | |
908 | + catalogomaterial_id bigint NOT NULL, | |
909 | + materialconsumo_id bigint NOT NULL, | |
910 | + CONSTRAINT alm_cm_item_pkey PRIMARY KEY (id), | |
911 | + CONSTRAINT fk_bnp4h6goh04umd2lvtetul8nh FOREIGN KEY (inativador_id) | |
912 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
913 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
914 | + CONSTRAINT fk_c5g3uvmexica8ughd7ykgfi1j FOREIGN KEY (catalogomaterial_id) | |
915 | + REFERENCES alm_catalogomaterial (id) MATCH SIMPLE | |
916 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
917 | + CONSTRAINT fk_cbhwaadbh34310mryn6dq9li3 FOREIGN KEY (organizacao_id) | |
918 | + REFERENCES organizacao (id) MATCH SIMPLE | |
919 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
920 | + CONSTRAINT fk_du9lemgnqhg77avdhujvxaanv FOREIGN KEY (autor_id) | |
921 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
922 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
923 | + CONSTRAINT fk_epelrqf3aktttgvyv53y1mvp FOREIGN KEY (materialconsumo_id) | |
924 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
925 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
926 | + CONSTRAINT fk_inuk562194dnsmj58vbr3j126 FOREIGN KEY (editor_id) | |
927 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
928 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
929 | +); | |
930 | + | |
931 | +CREATE TABLE alm_cm_undreqitem | |
932 | +( | |
933 | + id bigint NOT NULL, | |
934 | + databloqueio date, | |
935 | + datainativo date, | |
936 | + datacriacao timestamp without time zone NOT NULL, | |
937 | + dataedicao timestamp without time zone NOT NULL, | |
938 | + version bigint, | |
939 | + inativador_id bigint, | |
940 | + autor_id bigint, | |
941 | + editor_id bigint, | |
942 | + organizacao_id bigint, | |
943 | + catalogomaterial_id bigint NOT NULL, | |
944 | + unidaderequisitante_id bigint NOT NULL, | |
945 | + CONSTRAINT alm_cm_undreqitem_pkey PRIMARY KEY (id), | |
946 | + CONSTRAINT fk_294s488hbmpuepd6wfls4t3i9 FOREIGN KEY (inativador_id) | |
947 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
948 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
949 | + CONSTRAINT fk_5oc7drk4gya0nu35dwqyhdhkr FOREIGN KEY (catalogomaterial_id) | |
950 | + REFERENCES alm_catalogomaterial (id) MATCH SIMPLE | |
951 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
952 | + CONSTRAINT fk_akj8kbr08hp3129lks0835e9s FOREIGN KEY (unidaderequisitante_id) | |
953 | + REFERENCES estruturaorganizacional (id) MATCH SIMPLE | |
954 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
955 | + CONSTRAINT fk_bahetq98ci8w12tmolm070a8o FOREIGN KEY (editor_id) | |
956 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
957 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
958 | + CONSTRAINT fk_j2cmc135l6whf86wt0g1el3qy FOREIGN KEY (organizacao_id) | |
959 | + REFERENCES organizacao (id) MATCH SIMPLE | |
960 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
961 | + CONSTRAINT fk_scl46678vlyuwbyubforgplhc FOREIGN KEY (autor_id) | |
962 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
963 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
964 | +); | |
965 | + | |
966 | +CREATE TABLE alm_requisicaoconsumo | |
967 | +( | |
968 | + id bigint NOT NULL, | |
969 | + databloqueio date, | |
970 | + datainativo date, | |
971 | + datacriacao timestamp without time zone NOT NULL, | |
972 | + dataedicao timestamp without time zone NOT NULL, | |
973 | + version bigint, | |
974 | + datafinalizacaoatendimento timestamp without time zone, | |
975 | + datarequisicao timestamp without time zone, | |
976 | + numerorequisicao character varying(30), | |
977 | + inativador_id bigint, | |
978 | + autor_id bigint, | |
979 | + editor_id bigint, | |
980 | + organizacao_id bigint, | |
981 | + almoxarifado_id bigint NOT NULL, | |
982 | + centrocusto_id bigint, | |
983 | + tipostatusrequisicao_id bigint NOT NULL, | |
984 | + unidaderequisitante_id bigint NOT NULL, | |
985 | + CONSTRAINT alm_requisicaoconsumo_pkey PRIMARY KEY (id), | |
986 | + CONSTRAINT fk_2rtcpbfu6j54ytvkrb9jtohif FOREIGN KEY (tipostatusrequisicao_id) | |
987 | + REFERENCES dominio (id) MATCH SIMPLE | |
988 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
989 | + CONSTRAINT fk_ar232n8scv6owg2ydek8380ou FOREIGN KEY (unidaderequisitante_id) | |
990 | + REFERENCES estruturaorganizacional (id) MATCH SIMPLE | |
991 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
992 | + CONSTRAINT fk_e81qkn4fox1hsih8b3v0y8x8o FOREIGN KEY (autor_id) | |
993 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
994 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
995 | + CONSTRAINT fk_k3tw6c49ngn8xxy1dk9fgm5vy FOREIGN KEY (centrocusto_id) | |
996 | + REFERENCES centrocusto (id) MATCH SIMPLE | |
997 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
998 | + CONSTRAINT fk_ovunox81s57l0s2675w50yen FOREIGN KEY (organizacao_id) | |
999 | + REFERENCES organizacao (id) MATCH SIMPLE | |
1000 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1001 | + CONSTRAINT fk_qpembuodsqupq67fdugrb0a53 FOREIGN KEY (almoxarifado_id) | |
1002 | + REFERENCES estruturaorganizacional (id) MATCH SIMPLE | |
1003 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1004 | + CONSTRAINT fk_rdap15k23q9l952qvjtwtm4h3 FOREIGN KEY (editor_id) | |
1005 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1006 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1007 | + CONSTRAINT fk_tcwvovj7uyyajiss78og4w1lf FOREIGN KEY (inativador_id) | |
1008 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1009 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1010 | +); | |
1011 | + | |
1012 | +CREATE TABLE alm_devolucao | |
1013 | +( | |
1014 | + id bigint NOT NULL, | |
1015 | + databloqueio date, | |
1016 | + datainativo date, | |
1017 | + datacriacao timestamp without time zone NOT NULL, | |
1018 | + dataedicao timestamp without time zone NOT NULL, | |
1019 | + version bigint, | |
1020 | + codigo character varying(30), | |
1021 | + datadevolucao timestamp without time zone, | |
1022 | + justificativa character varying(500), | |
1023 | + inativador_id bigint, | |
1024 | + autor_id bigint, | |
1025 | + editor_id bigint, | |
1026 | + organizacao_id bigint, | |
1027 | + requisicao_id bigint NOT NULL, | |
1028 | + CONSTRAINT alm_devolucao_pkey PRIMARY KEY (id), | |
1029 | + CONSTRAINT fk_a0kk8jgf5w6gmv3fohw54ku5w FOREIGN KEY (organizacao_id) | |
1030 | + REFERENCES organizacao (id) MATCH SIMPLE | |
1031 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1032 | + CONSTRAINT fk_d63k1orwwrgpixvku8y6v0yqy FOREIGN KEY (autor_id) | |
1033 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1034 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1035 | + CONSTRAINT fk_edejl58jex7jfs18ue1ih1hir FOREIGN KEY (inativador_id) | |
1036 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1037 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1038 | + CONSTRAINT fk_h6xpqvti46xu1kqsqxra3lv2a FOREIGN KEY (editor_id) | |
1039 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1040 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1041 | + CONSTRAINT fk_idi0ykj68jgaen3msqtfvy8pd FOREIGN KEY (requisicao_id) | |
1042 | + REFERENCES alm_requisicaoconsumo (id) MATCH SIMPLE | |
1043 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1044 | +); | |
1045 | + | |
1046 | +CREATE TABLE alm_dev_documento | |
1047 | +( | |
1048 | + id bigint NOT NULL, | |
1049 | + devolucao_id bigint, | |
1050 | + devolucaoinativo_id bigint, | |
1051 | + CONSTRAINT alm_dev_documento_pkey PRIMARY KEY (id), | |
1052 | + CONSTRAINT fk_jiakoxluai4y62voc6hpdpjw9 FOREIGN KEY (id) | |
1053 | + REFERENCES documento (id) MATCH SIMPLE | |
1054 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1055 | + CONSTRAINT fk_l782dfs40d95akv2qqlyplipc FOREIGN KEY (devolucao_id) | |
1056 | + REFERENCES alm_devolucao (id) MATCH SIMPLE | |
1057 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1058 | + CONSTRAINT fk_qtgqs6flkp5apqvj069rj77u6 FOREIGN KEY (devolucaoinativo_id) | |
1059 | + REFERENCES alm_devolucao (id) MATCH SIMPLE | |
1060 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1061 | +); | |
1062 | + | |
1063 | +CREATE TABLE alm_dev_item | |
1064 | +( | |
1065 | + id bigint NOT NULL, | |
1066 | + databloqueio date, | |
1067 | + datainativo date, | |
1068 | + datacriacao timestamp without time zone NOT NULL, | |
1069 | + dataedicao timestamp without time zone NOT NULL, | |
1070 | + version bigint, | |
1071 | + quantidade numeric(19,2), | |
1072 | + inativador_id bigint, | |
1073 | + autor_id bigint, | |
1074 | + editor_id bigint, | |
1075 | + organizacao_id bigint, | |
1076 | + devolucao_id bigint NOT NULL, | |
1077 | + materialconsumo_id bigint NOT NULL, | |
1078 | + CONSTRAINT alm_dev_item_pkey PRIMARY KEY (id), | |
1079 | + CONSTRAINT fk_55xrqu0r4hurduwvvih7d0y26 FOREIGN KEY (autor_id) | |
1080 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1081 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1082 | + CONSTRAINT fk_5llj4rnuytri0v3ocn79f1mal FOREIGN KEY (materialconsumo_id) | |
1083 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
1084 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1085 | + CONSTRAINT fk_81jtiv200et09uag46xocbqeq FOREIGN KEY (devolucao_id) | |
1086 | + REFERENCES alm_devolucao (id) MATCH SIMPLE | |
1087 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1088 | + CONSTRAINT fk_hwts3vbywpijv5k3gx9788xpw FOREIGN KEY (editor_id) | |
1089 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1090 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1091 | + CONSTRAINT fk_nxs5alywm29dc1f4n8ub4kp66 FOREIGN KEY (organizacao_id) | |
1092 | + REFERENCES organizacao (id) MATCH SIMPLE | |
1093 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1094 | + CONSTRAINT fk_sulau6l09s8xrduwxqyjoxmi2 FOREIGN KEY (inativador_id) | |
1095 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1096 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1097 | +); | |
1098 | + | |
1099 | +CREATE TABLE alm_dev_observacao | |
1100 | +( | |
1101 | + id bigint NOT NULL, | |
1102 | + devolucao_id bigint NOT NULL, | |
1103 | + CONSTRAINT alm_dev_observacao_pkey PRIMARY KEY (id), | |
1104 | + CONSTRAINT fk_7smn823j6x5na4q53k7k96we3 FOREIGN KEY (id) | |
1105 | + REFERENCES observacao (id) MATCH SIMPLE | |
1106 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1107 | + CONSTRAINT fk_cuy6rqe0sod94y0kcjf04iqxv FOREIGN KEY (devolucao_id) | |
1108 | + REFERENCES alm_devolucao (id) MATCH SIMPLE | |
1109 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1110 | +); | |
1111 | + | |
1112 | +CREATE TABLE alm_eo_almoxarifado | |
1113 | +( | |
1114 | + id bigint NOT NULL, | |
1115 | + databloqueio date, | |
1116 | + datainativo date, | |
1117 | + datacriacao timestamp without time zone NOT NULL, | |
1118 | + dataedicao timestamp without time zone NOT NULL, | |
1119 | + version bigint, | |
1120 | + diasrequisicao character varying(255), | |
1121 | + isalmoxarifado boolean, | |
1122 | + isalmoxarifadopadrao boolean, | |
1123 | + isundconsumidorarequisitante boolean, | |
1124 | + inativador_id bigint, | |
1125 | + autor_id bigint, | |
1126 | + editor_id bigint, | |
1127 | + centrocusto_id bigint, | |
1128 | + estruturaorganizacional_id bigint NOT NULL, | |
1129 | + CONSTRAINT alm_eo_almoxarifado_pkey PRIMARY KEY (id), | |
1130 | + CONSTRAINT fk_1a0puuipc4ocvdbq4h39fe3a6 FOREIGN KEY (centrocusto_id) | |
1131 | + REFERENCES centrocusto (id) MATCH SIMPLE | |
1132 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1133 | + CONSTRAINT fk_76mfsc24itxa4n5g1jtpesev1 FOREIGN KEY (estruturaorganizacional_id) | |
1134 | + REFERENCES estruturaorganizacional (id) MATCH SIMPLE | |
1135 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1136 | + CONSTRAINT fk_8getuf8eb63hauqr11k7tcw73 FOREIGN KEY (inativador_id) | |
1137 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1138 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1139 | + CONSTRAINT fk_d17lg502rqbgl26obix1bq2ho FOREIGN KEY (autor_id) | |
1140 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1141 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1142 | + CONSTRAINT fk_sd63g4y6t38ewo1v7m2s7vmbs FOREIGN KEY (editor_id) | |
1143 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1144 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1145 | + CONSTRAINT uk_76mfsc24itxa4n5g1jtpesev1 UNIQUE (estruturaorganizacional_id) | |
1146 | +); | |
1147 | + | |
1148 | +CREATE TABLE alm_mc_unidmedidaentrada | |
1149 | +( | |
1150 | + id bigint NOT NULL, | |
1151 | + databloqueio date, | |
1152 | + datainativo date, | |
1153 | + inativador_id bigint, | |
1154 | + materialconsumo_id bigint, | |
1155 | + materialconsumoremocao_id bigint, | |
1156 | + unidademedida_id bigint NOT NULL, | |
1157 | + CONSTRAINT alm_mc_unidmedidaentrada_pkey PRIMARY KEY (id), | |
1158 | + CONSTRAINT fk_dhm8t4yhha7dqv7pyyppbttkx FOREIGN KEY (unidademedida_id) | |
1159 | + REFERENCES unidademedida (id) MATCH SIMPLE | |
1160 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1161 | + CONSTRAINT fk_e04vl07hegumg3lodcu7g5bj8 FOREIGN KEY (materialconsumoremocao_id) | |
1162 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
1163 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1164 | + CONSTRAINT fk_ja5nq76b6hs5wcdol4m5k38cj FOREIGN KEY (materialconsumo_id) | |
1165 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
1166 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1167 | + CONSTRAINT fk_tou1ikcim2a2qec4bqr9gwp1v FOREIGN KEY (inativador_id) | |
1168 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1169 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1170 | +); | |
1171 | + | |
1172 | +CREATE TABLE alm_mc_unidmedidaentrada_aud | |
1173 | +( | |
1174 | + id bigint NOT NULL, | |
1175 | + rev integer NOT NULL, | |
1176 | + revtype smallint, | |
1177 | + databloqueio date, | |
1178 | + datainativo date, | |
1179 | + materialconsumo_id bigint, | |
1180 | + materialconsumoremocao_id bigint, | |
1181 | + unidademedida_id bigint, | |
1182 | + CONSTRAINT alm_mc_unidmedidaentrada_aud_pkey PRIMARY KEY (id, rev) | |
1183 | +); | |
1184 | + | |
1185 | +CREATE TABLE alm_not_res_grupo | |
1186 | +( | |
1187 | + id bigint NOT NULL, | |
1188 | + databloqueio date, | |
1189 | + datainativo date, | |
1190 | + datacriacao timestamp without time zone NOT NULL, | |
1191 | + dataedicao timestamp without time zone NOT NULL, | |
1192 | + version bigint, | |
1193 | + inativador_id bigint, | |
1194 | + autor_id bigint, | |
1195 | + editor_id bigint, | |
1196 | + organizacao_id bigint, | |
1197 | + confignotificaressuprimento_id bigint, | |
1198 | + confignotificaressupremocao_id bigint, | |
1199 | + grupo_id bigint, | |
1200 | + CONSTRAINT alm_not_res_grupo_pkey PRIMARY KEY (id), | |
1201 | + CONSTRAINT fk_5i7ncxc578f98qp4iibtpnlmf FOREIGN KEY (confignotificaressuprimento_id) | |
1202 | + REFERENCES alm_not_ressuprimento (id) MATCH SIMPLE | |
1203 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1204 | + CONSTRAINT fk_8bm0o79i0mtdefjyjmddtlby4 FOREIGN KEY (inativador_id) | |
1205 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1206 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1207 | + CONSTRAINT fk_9y9ruw57i1i93qmxir7k1rnml FOREIGN KEY (confignotificaressupremocao_id) | |
1208 | + REFERENCES alm_not_ressuprimento (id) MATCH SIMPLE | |
1209 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1210 | + CONSTRAINT fk_c73ivikehs0i74nxihuk2rx08 FOREIGN KEY (organizacao_id) | |
1211 | + REFERENCES organizacao (id) MATCH SIMPLE | |
1212 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1213 | + CONSTRAINT fk_fvsnovw6rgkxxwg6ikrokqype FOREIGN KEY (grupo_id) | |
1214 | + REFERENCES grupo (id) MATCH SIMPLE | |
1215 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1216 | + CONSTRAINT fk_g939p30f7u1ghsurabnfkj1lc FOREIGN KEY (editor_id) | |
1217 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1218 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1219 | + CONSTRAINT fk_nnevrmdpskh6sh10ktwyiiq31 FOREIGN KEY (autor_id) | |
1220 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1221 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1222 | +); | |
1223 | + | |
1224 | +CREATE TABLE alm_not_res_usuario | |
1225 | +( | |
1226 | + id bigint NOT NULL, | |
1227 | + databloqueio date, | |
1228 | + datainativo date, | |
1229 | + datacriacao timestamp without time zone NOT NULL, | |
1230 | + dataedicao timestamp without time zone NOT NULL, | |
1231 | + version bigint, | |
1232 | + inativador_id bigint, | |
1233 | + autor_id bigint, | |
1234 | + editor_id bigint, | |
1235 | + organizacao_id bigint, | |
1236 | + confignotificaressuprimento_id bigint, | |
1237 | + confignotificaressupremocao_id bigint, | |
1238 | + usuario_id bigint NOT NULL, | |
1239 | + CONSTRAINT alm_not_res_usuario_pkey PRIMARY KEY (id), | |
1240 | + CONSTRAINT fk_52tg7hip8g3qgsinkgf0b3e4 FOREIGN KEY (inativador_id) | |
1241 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1242 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1243 | + CONSTRAINT fk_e3m1xqkl5yvn074w024l1qpp2 FOREIGN KEY (usuario_id) | |
1244 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1245 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1246 | + CONSTRAINT fk_ey9q0b7ndugyy40i2o7udg4rp FOREIGN KEY (confignotificaressuprimento_id) | |
1247 | + REFERENCES alm_not_ressuprimento (id) MATCH SIMPLE | |
1248 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1249 | + CONSTRAINT fk_lyr3ju29kp99yav6t2qn9um1r FOREIGN KEY (organizacao_id) | |
1250 | + REFERENCES organizacao (id) MATCH SIMPLE | |
1251 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1252 | + CONSTRAINT fk_ns1p5keyn8j5clpllpcnmne1n FOREIGN KEY (confignotificaressupremocao_id) | |
1253 | + REFERENCES alm_not_ressuprimento (id) MATCH SIMPLE | |
1254 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1255 | + CONSTRAINT fk_q5151hj1hkal163spejidd6q FOREIGN KEY (autor_id) | |
1256 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1257 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1258 | + CONSTRAINT fk_ro30in3erb0p8jpwi65nrodq4 FOREIGN KEY (editor_id) | |
1259 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1260 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1261 | +); | |
1262 | + | |
1263 | +CREATE TABLE alm_rc_item | |
1264 | +( | |
1265 | + id bigint NOT NULL, | |
1266 | + databloqueio date, | |
1267 | + datainativo date, | |
1268 | + datacriacao timestamp without time zone NOT NULL, | |
1269 | + dataedicao timestamp without time zone NOT NULL, | |
1270 | + version bigint, | |
1271 | + quantidade numeric(19,2), | |
1272 | + quantidadeatendida numeric(19,2), | |
1273 | + quantidadedevolvida numeric(19,2), | |
1274 | + inativador_id bigint, | |
1275 | + autor_id bigint, | |
1276 | + editor_id bigint, | |
1277 | + organizacao_id bigint, | |
1278 | + materialconsumo_id bigint NOT NULL, | |
1279 | + requisicaoconsumo_id bigint NOT NULL, | |
1280 | + CONSTRAINT alm_rc_item_pkey PRIMARY KEY (id), | |
1281 | + CONSTRAINT fk_3c8qistprafue9af90477bhme FOREIGN KEY (organizacao_id) | |
1282 | + REFERENCES organizacao (id) MATCH SIMPLE | |
1283 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1284 | + CONSTRAINT fk_c99x6hnjkd5usbsbou4qe40jo FOREIGN KEY (materialconsumo_id) | |
1285 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
1286 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1287 | + CONSTRAINT fk_e20htn00lsgfi01p2gvrpdayt FOREIGN KEY (inativador_id) | |
1288 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1289 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1290 | + CONSTRAINT fk_l5qufoktjn1lq4qnkv4le13rj FOREIGN KEY (requisicaoconsumo_id) | |
1291 | + REFERENCES alm_requisicaoconsumo (id) MATCH SIMPLE | |
1292 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1293 | + CONSTRAINT fk_oqoo2q47mdi9lbeh99kmxjyis FOREIGN KEY (editor_id) | |
1294 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1295 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1296 | + CONSTRAINT fk_trrimun78xirbwnn8pdnnn1kj FOREIGN KEY (autor_id) | |
1297 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1298 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1299 | +); | |
1300 | + | |
1301 | +CREATE TABLE alm_rc_observacao | |
1302 | +( | |
1303 | + id bigint NOT NULL, | |
1304 | + requisicaoconsumo_id bigint NOT NULL, | |
1305 | + CONSTRAINT alm_rc_observacao_pkey PRIMARY KEY (id), | |
1306 | + CONSTRAINT fk_1cd9vgprga28bm3go715m3eas FOREIGN KEY (id) | |
1307 | + REFERENCES observacao (id) MATCH SIMPLE | |
1308 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1309 | + CONSTRAINT fk_4cq3urvskeegc6dpjl86r96s2 FOREIGN KEY (requisicaoconsumo_id) | |
1310 | + REFERENCES alm_requisicaoconsumo (id) MATCH SIMPLE | |
1311 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1312 | +); | |
1313 | + | |
1314 | +CREATE TABLE alm_rc_atendimento | |
1315 | +( | |
1316 | + id bigint NOT NULL, | |
1317 | + databloqueio date, | |
1318 | + datainativo date, | |
1319 | + datacriacao timestamp without time zone NOT NULL, | |
1320 | + dataedicao timestamp without time zone NOT NULL, | |
1321 | + version bigint, | |
1322 | + dataatendimento timestamp without time zone, | |
1323 | + numeroatendimento character varying(30), | |
1324 | + inativador_id bigint, | |
1325 | + autor_id bigint, | |
1326 | + editor_id bigint, | |
1327 | + organizacao_id bigint, | |
1328 | + requisicaoconsumo_id bigint NOT NULL, | |
1329 | + CONSTRAINT alm_rc_atendimento_pkey PRIMARY KEY (id), | |
1330 | + CONSTRAINT fk_7prcgcdeydc36hqgc9evkyodf FOREIGN KEY (requisicaoconsumo_id) | |
1331 | + REFERENCES alm_requisicaoconsumo (id) MATCH SIMPLE | |
1332 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1333 | + CONSTRAINT fk_bwo6wjnhmt3fpc5fnoq0rmv92 FOREIGN KEY (organizacao_id) | |
1334 | + REFERENCES organizacao (id) MATCH SIMPLE | |
1335 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1336 | + CONSTRAINT fk_c4ntew46noy16bo4yu2rh66tt FOREIGN KEY (editor_id) | |
1337 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1338 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1339 | + CONSTRAINT fk_j1ifnut4jmt2r73xmtqdkv4h2 FOREIGN KEY (inativador_id) | |
1340 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1341 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1342 | + CONSTRAINT fk_phc5l7oaasb3ym7cloij4lxv FOREIGN KEY (autor_id) | |
1343 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1344 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1345 | +); | |
1346 | + | |
1347 | +CREATE TABLE alm_rc_atendimentoitem | |
1348 | +( | |
1349 | + id bigint NOT NULL, | |
1350 | + databloqueio date, | |
1351 | + datainativo date, | |
1352 | + datacriacao timestamp without time zone NOT NULL, | |
1353 | + dataedicao timestamp without time zone NOT NULL, | |
1354 | + version bigint, | |
1355 | + quantidade numeric(19,2), | |
1356 | + inativador_id bigint, | |
1357 | + autor_id bigint, | |
1358 | + editor_id bigint, | |
1359 | + organizacao_id bigint, | |
1360 | + atendimentoreqconsumo_id bigint NOT NULL, | |
1361 | + material_id bigint NOT NULL, | |
1362 | + requisicaoconsumoitem_id bigint NOT NULL, | |
1363 | + CONSTRAINT alm_rc_atendimentoitem_pkey PRIMARY KEY (id), | |
1364 | + CONSTRAINT fk_11fyc09hkikfrmktr7gxyduiy FOREIGN KEY (requisicaoconsumoitem_id) | |
1365 | + REFERENCES alm_rc_item (id) MATCH SIMPLE | |
1366 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1367 | + CONSTRAINT fk_6d4f0998i3ylo9n0p3db5yi4i FOREIGN KEY (autor_id) | |
1368 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1369 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1370 | + CONSTRAINT fk_a7putli22w7uxwjfcle7s3h8f FOREIGN KEY (inativador_id) | |
1371 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1372 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1373 | + CONSTRAINT fk_hhpk649se8vba32soog3esf2l FOREIGN KEY (atendimentoreqconsumo_id) | |
1374 | + REFERENCES alm_rc_atendimento (id) MATCH SIMPLE | |
1375 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1376 | + CONSTRAINT fk_jh7bb6ukkhhw29nc6kemyxiv2 FOREIGN KEY (editor_id) | |
1377 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1378 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1379 | + CONSTRAINT fk_or46npdrk4b7cxqn57scgitqt FOREIGN KEY (material_id) | |
1380 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
1381 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1382 | + CONSTRAINT fk_pvuivwxu1td48cm0ciku678hn FOREIGN KEY (organizacao_id) | |
1383 | + REFERENCES organizacao (id) MATCH SIMPLE | |
1384 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1385 | +); | |
1386 | + | |
1387 | +CREATE TABLE mat_matpermanenteconsumo | |
1388 | +( | |
1389 | + id bigint NOT NULL, | |
1390 | + databloqueio date, | |
1391 | + datainativo date, | |
1392 | + datacriacao timestamp without time zone NOT NULL, | |
1393 | + dataedicao timestamp without time zone NOT NULL, | |
1394 | + version bigint, | |
1395 | + inativador_id bigint, | |
1396 | + autor_id bigint, | |
1397 | + editor_id bigint, | |
1398 | + materialconsumo_id bigint, | |
1399 | + materialpermanente_id bigint, | |
1400 | + CONSTRAINT mat_matpermanenteconsumo_pkey PRIMARY KEY (id), | |
1401 | + CONSTRAINT fk_33w5ws6st88qm6jxro6dc64jf FOREIGN KEY (editor_id) | |
1402 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1403 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1404 | + CONSTRAINT fk_dk8utoxs4y4j7gl2wfefs671u FOREIGN KEY (inativador_id) | |
1405 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1406 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1407 | + CONSTRAINT fk_gl4xp5c57fd6h9s4tm8vts7lv FOREIGN KEY (materialconsumo_id) | |
1408 | + REFERENCES alm_materialconsumo (id) MATCH SIMPLE | |
1409 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1410 | + CONSTRAINT fk_hculumamc3oxvv8bjj1lywpea FOREIGN KEY (materialpermanente_id) | |
1411 | + REFERENCES materialpermanente (id) MATCH SIMPLE | |
1412 | + ON UPDATE NO ACTION ON DELETE NO ACTION, | |
1413 | + CONSTRAINT fk_olx53p76qqit7vcxis44iu2xp FOREIGN KEY (autor_id) | |
1414 | + REFERENCES seguranca_usuario (id) MATCH SIMPLE | |
1415 | + ON UPDATE NO ACTION ON DELETE NO ACTION | |
1416 | +); | |
1417 | + | |
1418 | +CREATE TABLE mat_matpermanenteconsumo_aud | |
1419 | +( | |
1420 | + id bigint NOT NULL, | |
1421 | + rev integer NOT NULL, | |
1422 | + revtype smallint, | |
1423 | + databloqueio date, | |
1424 | + datainativo date, | |
1425 | + datacriacao timestamp without time zone, | |
1426 | + dataedicao timestamp without time zone, | |
1427 | + autor_id bigint, | |
1428 | + editor_id bigint, | |
1429 | + materialconsumo_id bigint, | |
1430 | + materialpermanente_id bigint, | |
1431 | + CONSTRAINT mat_matpermanenteconsumo_aud_pkey PRIMARY KEY (id, rev) | |
1432 | +); | |
1433 | + | |
1434 | +DELETE FROM materialcaracteristica WHERE material_id IN (SELECT id FROM material WHERE dominiotipomaterial_id = (SELECT id FROM dominio WHERE chave = 'tipoMaterial' AND codigo = 1)); | |
1435 | +DELETE FROM material WHERE dominiotipomaterial_id = (SELECT id FROM dominio WHERE chave = 'tipoMaterial' AND codigo = 1); | |
1436 | + | |
1437 | +DELETE FROM contacontabilmovimento WHERE entrada_id NOT IN (SELECT id FROM entradapatrimonio); | |
1438 | +DELETE FROM entradaobservacao WHERE entrada_id NOT IN (SELECT id FROM entradapatrimonio); | |
1439 | +DELETE FROM entradadocumento WHERE entrada_id IS NOT null AND entrada_id NOT IN (SELECT id FROM entradapatrimonio); | |
1440 | +DELETE FROM entradadocumento WHERE entrada_id IS NOT null AND entradainativo_id NOT IN (SELECT id FROM entradapatrimonio); | |
1441 | +DELETE FROM entrada WHERE id NOT IN (SELECT id FROM entradapatrimonio); | |
1442 | + | |
1443 | +-- GEOVANE FIM 04/05/2016 | |
0 | 1444 | \ No newline at end of file | ... | ... |