✏️ 正在编辑: 244.sql
路径:
/srv/systems_dir/yuppiecred-lidernegocios/data/database/244.sql
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * Author: yuppie * Created: 15/01/2018 */ /* Padronização das actions */ SET NAMES 'utf8'; UPDATE `tb_resources` SET `privilege` = 'add-documento' WHERE `resource` = 'emprestimo-pessoal' AND `privilege` = 'anexar-documento'; /* Adição de Contrato assinado como novo tipo, para empréstimo pessoa*/ SET NAMES 'utf8'; INSERT INTO `tb_tipos` (`descricao`, `tipo`, `bloquear`, `excluido`, `desativar_cliente_callcenter`) VALUES ('Contrato assinado', 'ANEXO_EMPRESTIMO', '0', '0', '0'), ('Boleto', 'ANEXO_EMPRESTIMO', '0', '0', '0'), ('Contrato', 'ANEXO_EMPRESTIMO', '0', '0', '0'); /* IMPORTACAO DE ANEXOS DO CAMPO 'anexo_contrato_assinado' para tb_contratos_anexos */ SET NAMES 'utf8'; INSERT INTO `tb_contratos_anexos`(`contrato_id`, `tipo_id`, `arquivo`) SELECT `id` AS `contrato_id`, (SELECT `id` FROM `tb_tipos` WHERE `tipo` = "ANEXO_EMPRESTIMO" AND `descricao` = "Contrato assinado") AS `tipo_id`, `anexo_contrato_assinado` AS `arquivo` FROM `tb_contratos` WHERE `excluido` <> 1 AND `anexo_contrato_assinado` IS NOT NULL OR `anexo_contrato_assinado` <> ''; /* IMPORTACAO DE ANEXOS DO CAMPO 'anexo_boleto' para tb_contratos_anexos */ SET NAMES 'utf8'; INSERT INTO `tb_contratos_anexos`(`contrato_id`, `tipo_id`, `arquivo`) SELECT `id` AS `contrato_id`, (SELECT `id` FROM `tb_tipos` WHERE `tipo` = "ANEXO_EMPRESTIMO" AND `descricao` = "Boleto") AS `tipo_id`, `anexo_boleto` AS `arquivo` FROM `tb_contratos` WHERE `excluido` <> 1 AND `anexo_boleto` IS NOT NULL OR `anexo_boleto` <> ''; /* IMPORTACAO DE ANEXOS DO CAMPO 'anexo_contrato' para tb_contratos_anexos */ SET NAMES 'utf8'; INSERT INTO `tb_contratos_anexos`(`contrato_id`, `tipo_id`, `arquivo`) SELECT `id` AS `contrato_id`, (SELECT `id` FROM `tb_tipos` WHERE `tipo` = "ANEXO_EMPRESTIMO" AND `descricao` = "Contrato") AS `tipo_id`, `anexo_contrato` AS `arquivo` FROM `tb_contratos` WHERE `excluido` <> 1 AND `anexo_contrato` IS NOT NULL OR `anexo_contrato` <> ''; /* Remoção das colunas que migraram para a tb_contratos_anexos*/ ALTER TABLE `tb_contratos` DROP COLUMN `anexo_cpf`, DROP COLUMN `anexo_rg`, DROP COLUMN `anexo_contra_cheque`, DROP COLUMN `anexo_ficha_cadastral`, DROP COLUMN `anexo_beneficio`, DROP COLUMN `anexo_comprovante_residencia`, DROP COLUMN `anexo_termo_adesao`, DROP COLUMN `anexo_autorizacao_saque`, DROP COLUMN `anexo_arrogo_testemunha`, DROP COLUMN `anexo_capa`, DROP COLUMN `anexo_formulario`, DROP COLUMN `anexo_contrato_assinado`; /* Remoção da tabela que migrou para tb_contratos_anexo com o tipo "Outros documentos"*/ DROP TABLE `tb_propostas_documentos`;
💾 保存文件
← 返回文件管理器