diff --git a/src/db/migration/V20180606_1610__mantis11304.sql b/src/db/migration/V20180606_1610__mantis11304.sql new file mode 100644 index 000000000..f25d97dc2 --- /dev/null +++ b/src/db/migration/V20180606_1610__mantis11304.sql @@ -0,0 +1,41 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE UNIQUE INDEX PK__BPE__BPE_ID ON BPE ("BPE_ID")'; + exception when table_exists then null; +end; + +/ + +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE INDEX IDX__BPE_BOLETO ON BPE ("BOLETO_ID")'; + exception when table_exists then null; +end; + +/ + +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE INDEX IDX__BPE_BPESUBSTITUICAO ON BPE ("BPESUBSTITUICAO_ID")'; + exception when table_exists then null; +end; + +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'ALTER TABLE BPE ADD CONSTRAINT BPE_BOLETO FOREIGN KEY (BOLETO_ID) REFERENCES BOLETO (BOLETO_ID) ENABLE'; + exception when object_exists then null; +end; \ No newline at end of file