--------------------------------------------------------------------------
-- 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 
---DROP CONSTRAINT PRELISTAMON_AJUSTECALC_CK;
ALTER TABLE PRELISTAMON
Add CONSTRAINT PRELISTAMON_AJUSTECALC_CK CHECK (AJUSTECALCULO IN ('D','O','F','N'));

--- DROP CONSTRAINT PRELISTARES_PRECIOBASE_CK;
ALTER TABLE PRELISTARES
Add CONSTRAINT PRELISTARES_PRECIOBASE_CK CHECK (PRECIOBASE >= 0);

--- DROP CONSTRAINT PRELISTARES_PRECIOIVI_CK;
ALTER TABLE PRELISTARES
Add CONSTRAINT PRELISTARES_PRECIOIVI_CK CHECK (PRECIOIVI >= 0);

ALTER TABLE PRELISTARES
MODIFY(PROVEEDOR  NOT NULL);

ALTER TABLE PRELISTARES
MODIFY(COD_ARTICULO  NOT NULL);

ALTER TABLE PRELISTARES
MODIFY(LOCALIZA  NOT NULL);

ALTER TABLE PRELISTARES
MODIFY(DES_ARTICULO  NOT NULL);

--- DROP CONSTRAINT PRELISTA_LISTAMON_FK;
ALTER TABLE PRELISTAMON
   ADD CONSTRAINT PRELISTA_LISTAMON_FK FOREIGN KEY (COD_CIA, COD_LISTA_PRECIO)
      REFERENCES PRELISTA (COD_CIA, COD_LISTA_PRECIO);

--- DROP CONSTRAINT PREPARAMETRO_PREPAR_FK;
ALTER TABLE PREPARMONEDA
   ADD CONSTRAINT PREPARAMETRO_PREPAR_FK FOREIGN KEY (COD_CIA)
      REFERENCES PREPARAMETRO (COD_CIA);