fixes bug#20656

qua:wally
dev:fabio

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@104227 d1611594-4594-4d17-8e1d-87c2c4800839
master
walace 2020-11-10 19:55:21 +00:00
parent 6c26297f47
commit 5b47e28cd9
1 changed files with 94 additions and 0 deletions

View File

@ -0,0 +1,94 @@
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate 'ALTER TABLE EMPRESA drop column INDPRECIOPORDEMANDA';
exception
when object_exists then null;
when except_01451 then null;
when except_01442 then null;
end;
/
declare
begin
execute immediate 'update constante set activo = 0 where NOMBCONSTANTE = ''PERIODICIDADE_PORDEMANDA''';
exception when others then null;
end;
/
declare
object_exists exception;
except_01451 exception;
except_01442 exception;
pragma exception_init (object_exists , -01430);
pragma exception_init (except_01451 , -01451);
pragma exception_init (except_01442 , -01442);
begin
execute immediate 'ALTER TABLE RUTA ADD INDPRECIOPORDEMANDA NUMBER(1,0)';
exception
when object_exists then null;
when except_01451 then null;
when except_01442 then null;
end;
/
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate 'CREATE SEQUENCE TARIFA_DEMANDA_SEQ INCREMENT BY 1 START WITH 1 NOCYCLE';
exception when object_exists then null;
end;
/
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate 'CREATE TABLE TARIFA_DEMANDA (
TARIFADEMANDA_ID NUMBER(15,0) NOT NULL,
PRECIO NUMBER(10,2),
TRAMO_ID NUMBER(7,0),
MARCA_ID NUMBER(3,0) NOT NULL,
CLASESERVICIO_ID NUMBER(2,0),
PRECIOORIGINAL NUMBER(10,2),
CATEGORIAS VARCHAR2(255 BYTE),
PUNTOVENTAS VARCHAR2(255 BYTE),
ACTIVO NUMBER(1,0),
FECMODIF DATE,
FECINICIO DATE,
FECFIM DATE,
USUARIO_ID NUMBER(7,0),
IMPORTETAXAEMBARQUE NUMBER(7,2),
IMPORTEPEDAGIO NUMBER(7,2),
IMPORTEOUTROS NUMBER(7,2),
IMPORTESEGURO NUMBER(7,2),
ORGAOCONCEDENTE_ID NUMBER(7,2),
RUTA_ID NUMBER(7,0) NOT NULL,
ORIGEN_ID NUMBER(7,0) NOT NULL,
DESTINO_ID NUMBER(7,0) NOT NULL,
IMPORTETPP NUMBER(7,2),
PRIMARY KEY (TARIFADEMANDA_ID),
FOREIGN KEY (TRAMO_ID) REFERENCES TRAMO,
FOREIGN KEY (MARCA_ID) REFERENCES MARCA,
FOREIGN KEY (CLASESERVICIO_ID) REFERENCES CLASE_SERVICIO,
FOREIGN KEY (ORGAOCONCEDENTE_ID) REFERENCES ORGAO_CONCEDENTE,
FOREIGN KEY (RUTA_ID) REFERENCES RUTA,
FOREIGN KEY (ORIGEN_ID) REFERENCES PARADA,
FOREIGN KEY (DESTINO_ID) REFERENCES PARADA)';
exception when object_exists then null;
end;
/
declare
column_exists exception;
pragma exception_init (column_exists , -01430);
begin
execute immediate 'ALTER TABLE RUTA ADD FECINIPRECIODEMANDA DATE';
exception when column_exists then null;
end;
/
declare
column_exists exception;
pragma exception_init (column_exists , -01430);
begin
execute immediate 'ALTER TABLE RUTA ADD FECFIMPRECIODEMANDA DATE';
exception when column_exists then null;
end;