AdmMono/src/db/migration/V20240802_1345__AL-4549.sql

36 lines
1.0 KiB
SQL

declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate
'CREATE TABLE "VTABOL"."TRAYECTOS_EXPRESOS"
( "TRAYECTOSEXPRESOS_ID" NUMBER(15,0) NOT NULL PRIMARY KEY,
"DESCTRAYECTO" VARCHAR2(60 BYTE),
"VALORTRAYECTO" NUMBER(15,2),
"CANTVEHICULOS" NUMBER(3,0),
"ACTIVO" NUMBER(1,0),
"FECMODIF" DATE,
"USUARIO_ID" NUMBER(7,0),
"SOLICITUDEXPRESO_ID" NUMBER(15,0),
"NUMPLACA" VARCHAR2(8 BYTE),
"DOCFLUEC" BLOB
)';
exception when object_exists then null;
end;
/
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate
'CREATE SEQUENCE "TRAYECTOS_EXPRESO_SEQ" MINVALUE 10000 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 10000;';
exception when object_exists then null;
end;
begin
execute immediate
'ALTER TABLE "VTABOL"."TRAYECTOS_EXPRESOS"
ADD FOREIGN KEY ("SOLICITUDEXPRESO_ID")
REFERENCES "VTABOL"."SOLICITUD_EXPRESO" ("SOLICITUDEXPRESO_ID") ENABLE;';
exception when object_exists then null;
end;