CREATE TABLE CONFIGCARDTRAB (
	NRCONFIGCARDTRAB		NUMBER 														NOT NULL,
    NRCARDAPIOTRAB 			NUMBER														NOT NULL,
    CDTIPOPRAT 				VARCHAR2(2)													NOT NULL,
    DSCOMPLEMENTO 			VARCHAR2(50)												NOT NULL,
	IDCLASSIFICACAO			VARCHAR2(30)												NOT NULL
		CONSTRAINT CKC_IDCLASSIFICACAO_CNFIGCARDT CHECK (IDCLASSIFICACAO IN ('ALIMENTAR', 'LIMPEZA', 'DESCARTAVEL')),
    NRORDEM		 			NUMBER 														NOT NULL,
	IDTEMPERATURA			VARCHAR2(30)												NULL
		CONSTRAINT CKC_IDTEMPERATURA_CNFIGCARDT CHECK (IDTEMPERATURA IS NULL OR (IDTEMPERATURA IN ('FRIO', 'QUENTE'))),
	NRCONFIGCARDBASE		NUMBER														NULL,
	NRORG 					NUMBER			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 	NOT NULL,
	IDATIVO 				VARCHAR2(1) 	DEFAULT 'S' 								NOT NULL
		CONSTRAINT CKC_IDATIVO_CONFIGCARDTRAB CHECK (IDATIVO IN ('S', 'N')),
	DTINCLUSAO 				DATE 														NULL,
	DTULTATU 				DATE 														NULL,
	NRORGINCLUSAO 			NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 	NULL,
	CDOPERINCLUSAO 			VARCHAR2(12) 	DEFAULT '1' 								NULL,
	NRORGULTATU 			NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')	NULL,
	CDOPERULTATU 			VARCHAR2(12) 	DEFAULT '1' 								NULL,
	CONSTRAINT PK_CONFIGCARDTRAB PRIMARY KEY (NRCONFIGCARDTRAB)
)
/
ALTER TABLE CONFIGCARDTRAB ADD
	CONSTRAINT FKPLA01095CARDAPIOTRAB FOREIGN KEY (NRCARDAPIOTRAB)
		REFERENCES CARDAPIOTRAB (NRCARDAPIOTRAB)
/
CREATE INDEX FKPLA01095CARDAPIOTRAB ON CONFIGCARDTRAB (NRCARDAPIOTRAB)
/
ALTER TABLE CONFIGCARDTRAB ADD
	CONSTRAINT FKPLA01083TIPOPRAT FOREIGN KEY (CDTIPOPRAT)
		REFERENCES TIPOPRAT (CDTIPOPRAT)
/
CREATE INDEX FKPLA01083TIPOPRAT ON CONFIGCARDTRAB (CDTIPOPRAT)