From ccb3804d7f06f069f93160c0b69b78acd21153a4 Mon Sep 17 00:00:00 2001 From: wilian Date: Wed, 19 Feb 2020 20:50:31 +0000 Subject: [PATCH] bug#18029 bug#18028 dev:thiago qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@100307 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20200126_1119__mantis18028.sql | 36 +++++++++++++++++++ .../migration/V20200217_2128__mantis18029.sql | 14 ++++++++ .../migration/V20200126_1119__mantis18028.sql | 21 +++++++++++ .../migration/V20200217_2128__mantis18029.sql | 8 +++++ 4 files changed, 79 insertions(+) create mode 100644 src/db/migration/V20200126_1119__mantis18028.sql create mode 100644 src/db/migration/V20200217_2128__mantis18029.sql create mode 100644 src/db/postgresql/migration/V20200126_1119__mantis18028.sql create mode 100644 src/db/postgresql/migration/V20200217_2128__mantis18029.sql diff --git a/src/db/migration/V20200126_1119__mantis18028.sql b/src/db/migration/V20200126_1119__mantis18028.sql new file mode 100644 index 000000000..d3b23c568 --- /dev/null +++ b/src/db/migration/V20200126_1119__mantis18028.sql @@ -0,0 +1,36 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE PRICING_CTRL ( + PRICINGCTRL_ID NUMBER(7) NOT NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (PRICINGCTRL_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE PRICING_CTRL_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1'; + exception when object_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,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > PRICING > CONFIGURACAO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.PRICING.MENU.CONFIGURACAO'', +''1'',sysdate,''-1'')'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20200217_2128__mantis18029.sql b/src/db/migration/V20200217_2128__mantis18029.sql new file mode 100644 index 000000000..b30db2e3b --- /dev/null +++ b/src/db/migration/V20200217_2128__mantis18029.sql @@ -0,0 +1,14 @@ +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,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > PRICING > MODIFICACAO MASSIVA WS'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.PRICING.MODIFICACAOMASSIVAWS'', +''1'',sysdate,''-1'')'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20200126_1119__mantis18028.sql b/src/db/postgresql/migration/V20200126_1119__mantis18028.sql new file mode 100644 index 000000000..cdf1c1d98 --- /dev/null +++ b/src/db/postgresql/migration/V20200126_1119__mantis18028.sql @@ -0,0 +1,21 @@ +DO $$ +BEGIN + CREATE TABLE PRICING_CTRL ( + PRICINGCTRL_ID NUMBER(7) NOT NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (PRICINGCTRL_ID) + ); + + CREATE SEQUENCE PRICING_CTRL_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1; + + insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) + values (nextval('funcion_sistema_seq'),1,'ADM > PRICING > CONFIGURACAO','COM.RJCONSULTORES.ADMINISTRACION.GUI.PRICING.MENU.CONFIGURACAO',1,now(),1); + + EXCEPTION + WHEN duplicate_table THEN NULL; + WHEN duplicate_object THEN NULL; + WHEN unique_violation THEN NULL; +END +$$; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20200217_2128__mantis18029.sql b/src/db/postgresql/migration/V20200217_2128__mantis18029.sql new file mode 100644 index 000000000..85b24bed3 --- /dev/null +++ b/src/db/postgresql/migration/V20200217_2128__mantis18029.sql @@ -0,0 +1,8 @@ +DO $$ +BEGIN + insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) + values (nextval('funcion_sistema_seq'),1,'ADM > PRICING > MODIFICACAO MASSIVA WS','COM.RJCONSULTORES.ADMINISTRACION.GUI.PRICING.MODIFICACAOMASSIVAWS',1,now(),1); + EXCEPTION + WHEN unique_violation THEN NULL; +END +$$; \ No newline at end of file