AdmMono/src/db/migration/V20190723_1722__Mantis14878...

34 lines
1.2 KiB
MySQL

declare
table_exists exception;
pragma exception_init (table_exists , -00955);
begin
execute immediate
'CREATE TABLE "IMAGEM" ("IMAGEM_ID" NUMBER(7,0) NOT NULL ENABLE, "IMAGEM" BLOB, "ACTIVO" NUMBER(1,0), "FECMODIF" DATE, "USUARIO_ID" NUMBER(7,0), "NOMBIMAGEM" VARCHAR2(150 BYTE), CONSTRAINT "IMAGEM_PK" PRIMARY KEY ("IMAGEM_ID"))';
exception when table_exists then null;
end;
/
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate 'CREATE SEQUENCE IMAGEM_SEQ';
exception when object_exists then null;
end;
/
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate 'CREATE INDEX IDX_NOMBIMAGEM ON IMAGEM (NOMBIMAGEM ASC)';
exception when object_exists then null;
end;
/
declare
begin
execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) VALUES (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > CATALOGOS > IMAGEM'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.IMAGEM'',''1'',null,''2'')';
exception when others then null;
end;