--------------------------------------------------------------------------
-- Play this script in PRUEBAS@VISANY to make it look like DESA@VISMAR
--                                                                      --
-- Please review the script before using it to make sure it won't       --
-- cause any unacceptable data loss.                                    --
--                                                                      --
-- PRUEBAS@VISANY Schema Extracted by User PRUEBAS 
-- DESA@VISMAR Schema Extracted by User DESA 

ALTER TABLE CMSACUAFIL
MODIFY(VENCE  DEFAULT sysdate);

CREATE TABLE CMSCLAVESEMP
(
  CIA       CHAR(3 BYTE)                        NOT NULL,
  EMPLEADO  VARCHAR2(15 BYTE)                   NOT NULL,
  CLAVE     VARCHAR2(20 BYTE)                   NOT NULL
)
LOGGING 
NOCACHE
NOPARALLEL
NOMONITORING;

ALTER TABLE CMSCLAVESEMP
 ADD CONSTRAINT CMSCLAVESEMP_PK
 PRIMARY KEY
 (CIA, EMPLEADO);

CREATE TABLE CMSFECHAS
(
  AUTOMATICO    CHAR(1 BYTE)                    NOT NULL,
  FECHA_INICIO  DATE                            NOT NULL,
  FECHA_FINAL   DATE                            NOT NULL
)
LOGGING 
NOCACHE
NOPARALLEL
NOMONITORING;

ALTER TABLE CMSCLAVESEMP
 ADD CONSTRAINT PLAEMPLEADO_CMSCLAVES_FK 
 FOREIGN KEY (CIA, EMPLEADO) 
 REFERENCES PLAEMPLEADO (CIA,EMPLEADO);

_