diff --git a/src/db/migration/V20171227_1600__mantis9440.sql b/src/db/migration/V20171227_1600__mantis9440.sql new file mode 100644 index 000000000..9109df031 --- /dev/null +++ b/src/db/migration/V20171227_1600__mantis9440.sql @@ -0,0 +1,67 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE BPE + ( + BPE_ID NUMBER(7,0), + TIPOAMB NUMBER(1,0), + UF VARCHAR2(2 BYTE), + VERSAOAPLICACAO VARCHAR2(20 BYTE), + CODSTAT VARCHAR2(3 BYTE), + MOTIVO VARCHAR2(255 BYTE), + RETORNO_ID VARCHAR2(20 BYTE), + CHBPE VARCHAR2(44 BYTE), + DHRECBTO VARCHAR2(25 BYTE), + NPROT VARCHAR2(15 BYTE), + INDCONTINGENCIA NUMBER(1,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0) + )'; + + execute immediate 'CREATE SEQUENCE "BPE_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1'; + + exception when object_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (BOLETO_ID NUMBER(15))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (VERSAO VARCHAR2(8))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (CNPJ VARCHAR2(14))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (QRCODE VARCHAR2(255))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (CBP VARCHAR2(8))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/V20171228_1530__mantis9440.sql b/src/db/migration/V20171228_1530__mantis9440.sql new file mode 100644 index 000000000..03ac51428 --- /dev/null +++ b/src/db/migration/V20171228_1530__mantis9440.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE INSCRICAO_ESTADUAL ADD (INDBPE NUMBER(1))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/V20171228_1600__mantis9440.sql b/src/db/migration/V20171228_1600__mantis9440.sql new file mode 100644 index 000000000..2ec0fe0ed --- /dev/null +++ b/src/db/migration/V20171228_1600__mantis9440.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (ERROCONTINGENCIA VARCHAR2(255))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/V20180111_1700__mantis9440.sql b/src/db/migration/V20180111_1700__mantis9440.sql new file mode 100644 index 000000000..e44fcacd7 --- /dev/null +++ b/src/db/migration/V20180111_1700__mantis9440.sql @@ -0,0 +1,31 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION ADD (INDBPE NUMBER(1) DEFAULT 0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (INDBPE NUMBER(1) DEFAULT 0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (INDBPEEMPRESA NUMBER(1))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (INDBPEESTACAO NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20180126_1600__mantis9440.sql b/src/db/migration/V20180126_1600__mantis9440.sql new file mode 100644 index 000000000..0653ecfe6 --- /dev/null +++ b/src/db/migration/V20180126_1600__mantis9440.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (INDBPEUF NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file