AdmMono/src/db/migration/V20180608_1800__mantis10074...

58 lines
1.5 KiB
SQL

declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate
'CREATE TABLE FACTURACION_SICFE (
FACTURACIONSICFE_ID NUMBER(7) NOT NULL,
TIPOCFE NUMBER(5),
SERIE VARCHAR2(20),
NUMFISCALCFE NUMBER(20),
RUTEMISOR NUMBER(12),
HASH VARCHAR2(50),
TELEFONO VARCHAR2(14),
NUMOPERACION VARCHAR2(36),
PDFSICFE blob,
ACTIVO NUMBER(1),
FECMODIF DATE,
USUARIO_ID NUMBER(7),
PRIMARY KEY (FACTURACIONSICFE_ID)
)';
exception when object_exists then null;
end;
/
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate
'CREATE SEQUENCE FACTURACION_SICFE_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
exception when object_exists then null;
end;
/
declare
column_exists exception;
pragma exception_init (column_exists , -01430);
begin
execute immediate 'ALTER TABLE PUNTO_VENTA add SUCURSALDGI varchar2(10)';
exception when column_exists then null;
end;
/
declare
column_exists exception;
pragma exception_init (column_exists , -01430);
begin
execute immediate 'ALTER TABLE EMPRESA add TIPOTASA varchar2(1)';
exception when column_exists then null;
end;
/
declare
column_exists exception;
pragma exception_init (column_exists , -01430);
begin
execute immediate 'ALTER TABLE EMPRESA add PORCTASA NUMERIC(4,2)';
exception when column_exists then null;
end;