ALTER TABLE SERVICO ADD IDDISPONIVELMYMENU VARCHAR2(1) DEFAULT 'N' NOT NULL
   CONSTRAINT CKC_SERVICO_IDDISPONIVELMYMENU CHECK (IDDISPONIVELMYMENU IN ('S','N'))
/
CREATE TABLE COMPCARDPESQPME ( 
  NRORDPRACPME NUMBER(10) DEFAULT NULL NULL,  
  CDPRATO VARCHAR2(10) DEFAULT NULL NULL, 
  NRORG NUMBER(10) DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  NRCARDPME VARCHAR2(10) NOT NULL, 
  NRCARDIAPME VARCHAR2(10) NOT NULL, 
  CDTIPOPRAT VARCHAR2(2) DEFAULT NULL NULL, 
  NRCOMPCARDPESQPME NUMBER(10) NOT NULL, 
  CDFILAUXPRAT VARCHAR2(4) DEFAULT NULL NULL, 
  NRGRUPOPRATOPESQ NUMBER(10) DEFAULT NULL NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDFILCENTPME VARCHAR2(4) NOT NULL, 
  NRSEQPRACPME NUMBER(10) DEFAULT NULL NULL, 
  IDEXIBEPRATOPESQ VARCHAR2(1) DEFAULT 'S' NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT 1 NULL,
  CONSTRAINT PK_COMPCARDPESQPME PRIMARY KEY(NRCOMPCARDPESQPME)
)
/
ALTER TABLE COMPCARDPESQPME ADD CONSTRAINT CKC_IDEXIBEPRATOPESQ_COMPCAPME CHECK (IDEXIBEPRATOPESQ IS NULL OR ( IDEXIBEPRATOPESQ IN ('S','N')))
/
ALTER TABLE COMPCARDPESQPME ADD CONSTRAINT CKC_IDATIVO_COMPCARDPESQPME CHECK (IDATIVO IN ('S','N'))
/
ALTER TABLE COMPCARDPESQPME ADD CONSTRAINT FKMYM00024CARDIAPME FOREIGN KEY (CDFILCENTPME, NRCARDPME, NRCARDIAPME) REFERENCES CARDIAPME (CDFILCENTPME, NRCARDPME, NRCARDIAPME) ON DELETE CASCADE
/
CREATE INDEX FKMYM00024CARDIAPME ON COMPCARDPESQPME(CDFILCENTPME, NRCARDPME, NRCARDIAPME)
/
ALTER TABLE COMPCARDPESQPME ADD CONSTRAINT FKMYM00025PRATO FOREIGN KEY (CDFILAUXPRAT, CDPRATO) REFERENCES PRATO (CDFILAUXPRAT, CDPRATO)
/
CREATE INDEX FKMYM00025PRATO ON COMPCARDPESQPME(CDFILAUXPRAT, CDPRATO)
/
ALTER TABLE COMPCARDPESQPME ADD CONSTRAINT FKMYM00026TIPOPRAT FOREIGN KEY (CDTIPOPRAT) REFERENCES TIPOPRAT (CDTIPOPRAT)
/
CREATE INDEX FKMYM00026TIPOPRAT ON COMPCARDPESQPME(CDTIPOPRAT)
/
ALTER TABLE COMPCARDPESQPME ADD CONSTRAINT FKMYM00027GRUPOPRATOPESQ FOREIGN KEY (NRGRUPOPRATOPESQ) REFERENCES GRUPOPRATOPESQ(NRGRUPOPRATOPESQ)
/
CREATE INDEX FKMYM00027GRUPOPRATOPESQ ON COMPCARDPESQPME(NRGRUPOPRATOPESQ)