From af174524ebf30a4febabc5cfce10ae1d3a629835 Mon Sep 17 00:00:00 2001 From: "lucas.taia" Date: Fri, 11 Dec 2020 23:54:52 +0000 Subject: [PATCH] bug#00000 dev:lucas qua: scripts Ebus git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@104693 d1611594-4594-4d17-8e1d-87c2c4800839 --- src/db/migration/V20201211_2015__jira166.sql | 95 ++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 src/db/migration/V20201211_2015__jira166.sql diff --git a/src/db/migration/V20201211_2015__jira166.sql b/src/db/migration/V20201211_2015__jira166.sql new file mode 100644 index 000000000..f5632701a --- /dev/null +++ b/src/db/migration/V20201211_2015__jira166.sql @@ -0,0 +1,95 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (STATUS VARCHAR2(2) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (INDCUPOMDESCONTO NUMBER(1) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (DESCUENTOPORCENTAJEVOLTA NUMBER(7,2) ) '; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING_IMPORTE ADD (DESCUENTOPORCENTAJEVOLTA NUMBER(7,2) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING_IMPORTE ADD (DESCUENTOPORCREDONDO NUMBER(7,2) )'; + exception when column_exists then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, USUARIO_ID) VALUES (FUNCION_SISTEMA_SEQ.NEXTVAL, ''1'', ''EBUS > PRICING ESPECIALISTA'', ''COM.RJCONSULTORES.EBUS.GUI.PRICING.ESPECIALISTA'', ''1'', ''1'')'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, USUARIO_ID) VALUES (FUNCION_SISTEMA_SEQ.NEXTVAL, ''1'', ''EBUS > PRICING GESTOR', 'COM.RJCONSULTORES.EBUS.GUI.PRICING.GESTOR'', ''1'', ''1'')'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE gestao_operador ( + gestaooperador_id NUMBER(7) NOT NULL, + usuario_id NUMBER(7), + porcentaje NUMBER(7, 2), + valor NUMBER(7, 2), + activo NUMBER(1), + fecmodif DATE, + usuariomodif_id NUMBER(7), + CONSTRAINT gestao_operador_pk PRIMARY KEY ( gestaooperador_id ) ENABLE )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE GESTAO_OPERADOR_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file