From 264b10f1d9e66573fa261dbc972b978999781cca Mon Sep 17 00:00:00 2001 From: alberto Date: Mon, 3 Sep 2018 19:35:08 +0000 Subject: [PATCH] =?UTF-8?q?Adapta=C3=A7=C3=A3o=20do=20Totalbus=20para=20se?= =?UTF-8?q?r=20compat=C3=ADvel=20com=20o=20postgresql=20bug#11508=20dev:tr?= =?UTF-8?q?evezani=20qua:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@85027 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20180626_0919__mantis11414.sql | 8 +++++++ .../migration/V20180709_1635__mantis11414.sql | 23 +++++++++++++++++++ .../migration/V20180710_1634__mantis11414.sql | 7 ++++++ .../migration/V20180712_1020__mantis11414.sql | 8 +++++++ .../migration/V20180713_1015__mantis11495.sql | 15 ++++++++++++ .../migration/V20180717_1138__mantis11414.sql | 8 +++++++ .../migration/V20180723_1530__mantis11522.sql | 7 ++++++ .../migration/V20180724_1141__mantis11649.sql | 14 +++++++++++ 8 files changed, 90 insertions(+) create mode 100644 src/db/postgresql/migration/V20180626_0919__mantis11414.sql create mode 100644 src/db/postgresql/migration/V20180709_1635__mantis11414.sql create mode 100644 src/db/postgresql/migration/V20180710_1634__mantis11414.sql create mode 100644 src/db/postgresql/migration/V20180712_1020__mantis11414.sql create mode 100644 src/db/postgresql/migration/V20180713_1015__mantis11495.sql create mode 100644 src/db/postgresql/migration/V20180717_1138__mantis11414.sql create mode 100644 src/db/postgresql/migration/V20180723_1530__mantis11522.sql create mode 100644 src/db/postgresql/migration/V20180724_1141__mantis11649.sql diff --git a/src/db/postgresql/migration/V20180626_0919__mantis11414.sql b/src/db/postgresql/migration/V20180626_0919__mantis11414.sql new file mode 100644 index 000000000..1e4d12036 --- /dev/null +++ b/src/db/postgresql/migration/V20180626_0919__mantis11414.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 > RELATORIO > MOVIMENTACAO ESTOQUE','COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOMOVIMENTACAOESTOQUE',1,now(),1); + + EXCEPTION WHEN unique_violation THEN NULL; +END +$$; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20180709_1635__mantis11414.sql b/src/db/postgresql/migration/V20180709_1635__mantis11414.sql new file mode 100644 index 000000000..92defeef6 --- /dev/null +++ b/src/db/postgresql/migration/V20180709_1635__mantis11414.sql @@ -0,0 +1,23 @@ +DO $$ +BEGIN + CREATE TABLE DET_ABASTO_BOLETO_HIST ( + DETABASTOBOLETOHIST_ID NUMERIC(15) NOT NULL, + DETABASTOBOLETOENV_ID INTEGER NULL, + DETABASTOBOLETOREC_ID INTEGER NULL, + FECMODIF TIME without TIME zone, + ACTIVO SMALLINT, + USUARIO_ID INTEGER, + PRIMARY KEY (DETABASTOBOLETOHIST_ID), + FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO, + FOREIGN KEY (DETABASTOBOLETOREC_ID) REFERENCES DET_ABASTO_BOLETO, + FOREIGN KEY (DETABASTOBOLETOENV_ID) REFERENCES DET_ABASTO_BOLETO + ); + + CREATE SEQUENCE DET_ABASTO_BOLETO_HIST_SEQ INCREMENT BY 1 START WITH 1 NO CYCLE; + + EXCEPTION + WHEN duplicate_table THEN NULL; + WHEN duplicate_object THEN NULL; + WHEN duplicate_column THEN NULL; +END +$$; diff --git a/src/db/postgresql/migration/V20180710_1634__mantis11414.sql b/src/db/postgresql/migration/V20180710_1634__mantis11414.sql new file mode 100644 index 000000000..1236930ae --- /dev/null +++ b/src/db/postgresql/migration/V20180710_1634__mantis11414.sql @@ -0,0 +1,7 @@ +DO $$ +BEGIN + ALTER TABLE REQUISICION_BOLETO ADD COLUMN INDDISTRIBUICAOESTOQUE NUMERIC(1,0); + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; diff --git a/src/db/postgresql/migration/V20180712_1020__mantis11414.sql b/src/db/postgresql/migration/V20180712_1020__mantis11414.sql new file mode 100644 index 000000000..f7fc9c336 --- /dev/null +++ b/src/db/postgresql/migration/V20180712_1020__mantis11414.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'),2,'VDA > ESTOQUE BILHETE > TRANSFERENCIA ESTOQUE','COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUTRANSFERENCIAESTOQUE',1,now(),1); + + EXCEPTION WHEN unique_violation THEN NULL; +END +$$; diff --git a/src/db/postgresql/migration/V20180713_1015__mantis11495.sql b/src/db/postgresql/migration/V20180713_1015__mantis11495.sql new file mode 100644 index 000000000..73f47f642 --- /dev/null +++ b/src/db/postgresql/migration/V20180713_1015__mantis11495.sql @@ -0,0 +1,15 @@ +DO $$ +BEGIN + insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (nextval('funcion_sistema_seq'),1,'ADM > RELATORIOS >> CADASTRO CLIENTES','COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.CADASTROCLIENTES',1,now(),1); + + ALTER TABLE CLIENTE ADD COLUMN FECCADASTRO DATE, ADD COLUMN EMPRESA_ID INTEGER, ADD COLUMN PUNTOVENTA_ID INTEGER; + + ALTER TABLE CLIENTE ADD CONSTRAINT CLIENTE_EMPRESA FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA (EMPRESA_ID); + + EXCEPTION + WHEN unique_violation THEN NULL; + WHEN duplicate_column THEN NULL; + WHEN duplicate_object THEN NULL; +END +$$; diff --git a/src/db/postgresql/migration/V20180717_1138__mantis11414.sql b/src/db/postgresql/migration/V20180717_1138__mantis11414.sql new file mode 100644 index 000000000..ed74412c6 --- /dev/null +++ b/src/db/postgresql/migration/V20180717_1138__mantis11414.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'),2,'VDA > ESTOQUE BILHETE > AUTORIZACAO CADASTRO ESTOQUE DISTRIBUICAO','COM.RJCONSULTORES.SCO.VDA.ESTOQUE.AUTORIZACAOCADASTROESTOQUEDISTRIBUICAO',1,now(),1); + + EXCEPTION WHEN unique_violation THEN NULL; +END +$$; diff --git a/src/db/postgresql/migration/V20180723_1530__mantis11522.sql b/src/db/postgresql/migration/V20180723_1530__mantis11522.sql new file mode 100644 index 000000000..c64370210 --- /dev/null +++ b/src/db/postgresql/migration/V20180723_1530__mantis11522.sql @@ -0,0 +1,7 @@ +DO $$ +BEGIN + ALTER TABLE BPE ALTER COLUMN RETORNO_ID TYPE VARCHAR(100); + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; diff --git a/src/db/postgresql/migration/V20180724_1141__mantis11649.sql b/src/db/postgresql/migration/V20180724_1141__mantis11649.sql new file mode 100644 index 000000000..7577c2b6c --- /dev/null +++ b/src/db/postgresql/migration/V20180724_1141__mantis11649.sql @@ -0,0 +1,14 @@ +DO $$ +BEGIN + DROP INDEX TARIFA_UNICA; + + CREATE UNIQUE INDEX UNQ_TARIFA ON TARIFA + (COALESCE(TRAMO_ID,-1), COALESCE(MARCA_ID,-1), COALESCE(CLASESERVICIO_ID,-1), COALESCE(MONEDA_ID,-1), COALESCE(VIGENCIATARIFA_ID,-1), COALESCE(ORGAOCONCEDENTE_ID,-1), COALESCE(RUTA_ID)) + WHERE ACTIVO = 1; + + EXCEPTION + WHEN undefined_object THEN NULL; + WHEN duplicate_object THEN NULL; + WHEN duplicate_table THEN NULL; +END +$$;