atualizar_bd_mysql_19.sql
10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
UPDATE versao SET versao_bd=19;
DROP TABLE IF EXISTS projeto_anexo_a;
CREATE TABLE projeto_anexo_a (
projeto_id INTEGER(100) UNSIGNED DEFAULT NULL,
finalidade TEXT,
objetivos_pretendidos TEXT,
beneficios_implementacao TEXT,
equipe_viabilidade TEXT,
objetivo_estrategico TEXT,
objetivo_estrategico_id INTEGER(100) UNSIGNED DEFAULT NULL,
acoes_curso TEXT,
publico_atingido TEXT,
consequencia_nao_implementacao TEXT,
riscos_alinhamento_estrategico TEXT,
alternativas_possiveis TEXT,
diplomas_legais TEXT,
grupos_interesse TEXT,
analise_grupos_interesse TEXT,
riscos_fatores_legais TEXT,
analise_inicial_ambiental TEXT,
acoes_minimizar_impacto_ambiental TEXT,
resultados_acoes_ambientais TEXT,
riscos_ambientais TEXT,
metas_projeto TEXT,
tamanho TEXT,
localizacao TEXT,
tipo_engenharia TEXT,
infra_estrutura TEXT,
alterativas_tecnicas TEXT,
ciclo_vida TEXT,
licoes_apreendidas_similares TEXT,
riscos_tecnico TEXT,
custo_projeto_operacao TEXT,
recursos_empregados_implantacao TEXT,
recursos_empregados_operacao TEXT,
proposta_inclusao_orcamento TEXT,
alternativas_financiamento TEXT,
resultados_economicos TEXT,
riscos_economico TEXT,
projetos_anteriormente_concluidos TEXT,
estimativa_efetivo TEXT,
estimativa_regime_trabalho TEXT,
prioridade_projeto TEXT,
consultorias_implantacao TEXT,
espaco_tempo_planejamento_execucao TEXT,
espaco_tempo_obtencao_recursos TEXT,
data_limite_compensadora DATE DEFAULT NULL,
prazo_viavel_implantacao TEXT,
riscos_gerenciais TEXT,
sintese_riscos TEXT,
medidas_minimizar_risco TEXT,
demonstracao_viabilidade TEXT,
condicoes_sustentabilidade TEXT,
parecer TEXT,
nome_posto VARCHAR(200) DEFAULT NULL,
KEY projeto_id (projeto_id)
)ENGINE=InnoDB;
DROP TABLE IF EXISTS projeto_anexo_arquivos;
CREATE TABLE projeto_anexo_arquivos (
pa_arquivos_id INTEGER(100) UNSIGNED NOT NULL AUTO_INCREMENT,
pa_arquivo_projeto_id INTEGER(100) UNSIGNED DEFAULT '0',
pa_arquivo_campo VARCHAR(50) DEFAULT NULL,
pa_arquivo_ordem INTEGER(100) UNSIGNED DEFAULT '0',
pa_arquivo_endereco VARCHAR(150) DEFAULT NULL,
pa_arquivo_data DATETIME DEFAULT NULL,
pa_arquivo_usuario INTEGER(100) UNSIGNED DEFAULT '0',
pa_arquivo_nome VARCHAR(150) DEFAULT NULL,
pa_arquivo_tipo VARCHAR(50) DEFAULT NULL,
pa_arquivo_extensao VARCHAR(50) DEFAULT NULL,
PRIMARY KEY (pa_arquivos_id),
KEY pa_arquivo_projeto_id (pa_arquivo_projeto_id)
)ENGINE=InnoDB;
DROP TABLE IF EXISTS projeto_anexo_a_equipe;
CREATE TABLE projeto_anexo_a_equipe (
equipe_id INTEGER(100) UNSIGNED NOT NULL AUTO_INCREMENT,
posto VARCHAR(40) DEFAULT NULL,
arma VARCHAR(40) DEFAULT NULL,
nome_completo VARCHAR(100) DEFAULT NULL,
funcao VARCHAR(100) DEFAULT NULL,
telefone1 VARCHAR(40) DEFAULT NULL,
telefone2 VARCHAR(40) DEFAULT NULL,
email VARCHAR(100) DEFAULT NULL,
contato_id INTEGER(100) UNSIGNED DEFAULT NULL,
ordem INTEGER(100) UNSIGNED NULL,
projeto_id INTEGER(100) UNSIGNED DEFAULT NULL,
usuario_inseriu INTEGER(100) UNSIGNED DEFAULT NULL,
data DATETIME DEFAULT NULL,
om VARCHAR(50) DEFAULT NULL,
PRIMARY KEY (equipe_id)
)ENGINE=InnoDB;
DROP TABLE IF EXISTS projeto_anexo_b;
CREATE TABLE projeto_anexo_b (
projeto_id int(100) unsigned DEFAULT NULL,
referencias text,
outros_objetivos text,
programa_inserido text,
fatores_determinantes_acao text,
objetivos text,
prioridade text,
emprego_operacional text,
atuacao_conjunta text,
acoes_esperadas text,
dispositivo_legal text,
direcionamento_didatico text,
integracao_outros_projetos text,
orgao_gestor text,
local text,
vinculacoes text,
regulacao_funcionamento text,
acrescimo_efetivo text,
outras_premissas text,
cargo_gerente text,
responsabilidades_alem_gerente text,
marcos_metas text,
faseamento text,
outras_instrucoes text,
gerente text,
supervisor text,
integrantes_equipe text,
etapas_imposta text,
regime_trabalho varchar(20) DEFAULT 'cumulativo',
condicionantes text,
movimentacao_pessoal text,
supressao_etapas text,
instrutores text,
outras_da_organizacao text,
recursos_disponiveis text,
atribuicoes_outros text,
atribuicoes_gerente text,
atribuicoes_supervisor text,
prescricoes_diversas text,
KEY projeto_id (projeto_id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS projeto_anexo_b_atribuicao;
CREATE TABLE projeto_anexo_b_atribuicao (
atribuicao_id int(100) unsigned NOT NULL AUTO_INCREMENT,
funcao varchar(100) DEFAULT NULL,
texto text,
ordem int(11) DEFAULT NULL,
projeto_id int(100) unsigned DEFAULT NULL,
usuario_inseriu int(100) unsigned DEFAULT NULL,
data datetime DEFAULT NULL,
PRIMARY KEY (atribuicao_id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS projeto_anexo_c;
CREATE TABLE projeto_anexo_c (
projeto_id INTEGER(100) UNSIGNED DEFAULT NULL,
produtos TEXT,
exclusoes_especificas TEXT,
fatores_sucesso TEXT,
KEY projeto_id (projeto_id)
)ENGINE=InnoDB;
ALTER TABLE projetos ADD COLUMN projeto_supervisor INTEGER(100) UNSIGNED DEFAULT 0;
ALTER TABLE projetos ADD COLUMN projeto_autoridade INTEGER(100) UNSIGNED DEFAULT 0;
ALTER TABLE contatos ADD COLUMN contato_nomecompleto VARCHAR(255) DEFAULT NULL;
DROP TABLE IF EXISTS projeto_contatos;
CREATE TABLE projeto_contatos (
projeto_contato_id INTEGER(100) UNSIGNED NOT NULL AUTO_INCREMENT,
projeto_id INTEGER(100) UNSIGNED NOT NULL DEFAULT '0',
contato_id INTEGER(100) UNSIGNED NOT NULL DEFAULT '0',
ordem INTEGER(100) UNSIGNED DEFAULT NULL,
envolvimento VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (projeto_contato_id),
KEY projeto_id (projeto_id),
KEY contato_id (contato_id)
)ENGINE=InnoDB;
DROP TABLE IF EXISTS projeto_integrantes;
CREATE TABLE projeto_integrantes (
projeto_integrantes_id INTEGER(100) UNSIGNED NOT NULL AUTO_INCREMENT,
projeto_id INTEGER(100) UNSIGNED NOT NULL DEFAULT '0',
contato_id INTEGER(100) UNSIGNED NOT NULL DEFAULT '0',
ordem INTEGER(100) UNSIGNED DEFAULT NULL,
funcao_projeto VARCHAR(255) DEFAULT NULL,
responsabilidade text,
PRIMARY KEY (projeto_integrantes_id),
KEY projeto_id (projeto_id),
KEY contato_id (contato_id)
)ENGINE=InnoDB;
DROP TABLE IF EXISTS projeto_anexo_f;
CREATE TABLE projeto_anexo_f (
projeto_id INTEGER(100) UNSIGNED DEFAULT NULL,
premissas TEXT,
restricoes TEXT,
KEY projeto_id (projeto_id)
)ENGINE=InnoDB;
DROP TABLE IF EXISTS projeto_anexo_h;
CREATE TABLE projeto_anexo_h (
risco_id INTEGER(100) UNSIGNED NOT NULL AUTO_INCREMENT,
projeto_id INTEGER(100) UNSIGNED,
ordem INTEGER(100) UNSIGNED,
descricao VARCHAR(255),
categoria VARCHAR(1),
probabilidade1 VARCHAR(1),
impacto1 VARCHAR(1),
criticidade1 VARCHAR(1),
estrategia VARCHAR(20),
acao_proposta TEXT,
probabilidade2 VARCHAR(1),
impacto2 VARCHAR(1),
criticidade2 VARCHAR(1),
contato_id INTEGER(100) UNSIGNED,
data DATE DEFAULT NULL,
usuario_inseriu INTEGER(100) UNSIGNED DEFAULT NULL,
data_inseriu DATETIME DEFAULT NULL,
PRIMARY KEY (risco_id),
KEY (projeto_id)
)ENGINE=InnoDB;
DROP TABLE IF EXISTS projeto_anexo_i;
CREATE TABLE projeto_anexo_i (
comunicacoes_id INTEGER(100) UNSIGNED NOT NULL AUTO_INCREMENT,
projeto_id INTEGER(100) UNSIGNED DEFAULT NULL,
ordem INTEGER(100) UNSIGNED DEFAULT NULL,
evento VARCHAR(255) DEFAULT NULL,
objetivo TEXT ,
audiencia TEXT ,
periodicidade TEXT ,
meio TEXT ,
usuario_inseriu INTEGER(100) UNSIGNED DEFAULT NULL,
data_inseriu DATETIME DEFAULT NULL,
PRIMARY KEY (comunicacoes_id),
KEY projeto_id (projeto_id)
)ENGINE=InnoDB;
DROP TABLE IF EXISTS projeto_anexo_j;
CREATE TABLE projeto_anexo_j (
qualidade_id INTEGER(100) UNSIGNED NOT NULL AUTO_INCREMENT,
projeto_id INTEGER(100) UNSIGNED DEFAULT NULL,
atividade_id INTEGER(100) UNSIGNED DEFAULT NULL,
ordem INTEGER(100) UNSIGNED DEFAULT NULL,
requisito VARCHAR(255) DEFAULT NULL,
pratica_indicador_id INTEGER(100) UNSIGNED DEFAULT NULL,
acao TEXT,
contato_id INTEGER(100) UNSIGNED DEFAULT NULL,
recurso TEXT,
treinamento TEXT,
usuario_inseriu INTEGER(100) UNSIGNED DEFAULT NULL,
data_inseriu DATETIME DEFAULT NULL,
PRIMARY KEY (qualidade_id),
KEY projeto_id (projeto_id),
KEY atividade_id (atividade_id)
)ENGINE=InnoDB;
DROP TABLE IF EXISTS projeto_anexo_j_atividade;
CREATE TABLE projeto_anexo_j_atividade (
atividade_id INTEGER(100) UNSIGNED NOT NULL AUTO_INCREMENT,
projeto_id INTEGER(100) UNSIGNED DEFAULT NULL,
ordem INTEGER(100) UNSIGNED DEFAULT NULL,
nome VARCHAR(255) DEFAULT NULL,
usuario_inseriu INTEGER(100) UNSIGNED DEFAULT NULL,
data_inseriu DATETIME DEFAULT NULL,
PRIMARY KEY (atividade_id),
KEY projeto_id (projeto_id)
)ENGINE=InnoDB;
DROP TABLE IF EXISTS projeto_anexo_k;
CREATE TABLE projeto_anexo_k (
projeto_id INTEGER(100) UNSIGNED DEFAULT NULL,
competencias TEXT,
avaliacao_equipe TEXT,
prescricoes_diversas TEXT,
KEY (projeto_id)
)ENGINE=InnoDB;
ALTER TABLE tarefa_custos ADD COLUMN tarefa_custos_data_limite DATE DEFAULT NULL;
ALTER TABLE tarefa_gastos ADD COLUMN tarefa_custos_data_recebido DATE DEFAULT NULL;
DROP TABLE IF EXISTS projeto_anexo_m;
CREATE TABLE projeto_anexo_m (
projeto_id INTEGER(100) UNSIGNED DEFAULT NULL,
tarefas_atrasadas TEXT,
tarefas_inseridas TEXT,
mudancas_padrao TEXT,
info_mudancas_escolpo TEXT,
data_inicial_fim VARCHAR(255) DEFAULT NULL,
alteracoes_data TEXT,
info_mudancas_data TEXT,
recurso_previsto TEXT,
recurso_aplicado TEXT,
necessidade_acrescimo TEXT,
outros_recursos TEXT,
info_mudancas_recurso TEXT,
problemas TEXT,
acoes_realizadas TEXT,
novos_riscos TEXT,
acoes_novos_riscos TEXT,
auditorias TEXT,
decisoes TEXT,
licoes_aprendidas TEXT,
outras_observacoes TEXT,
KEY projeto_id (projeto_id)
)ENGINE=InnoDB;
ALTER TABLE projetos ADD COLUMN projeto_objetivo_estrategico INTEGER(100) UNSIGNED DEFAULT '0';
ALTER TABLE projetos ADD COLUMN projeto_estrategia INTEGER(100) UNSIGNED DEFAULT '0';
ALTER TABLE projetos ADD COLUMN projeto_indicador INTEGER(100) UNSIGNED DEFAULT '0';