CREATE TABLE INFORMATIVOECOMSILE (
    ID               NUMBER        NOT NULL,
    DSNOME           VARCHAR2(500) NOT NULL,
    QTDIAS           NUMBER        NOT NULL,
    CDPUBLICOALVO    VARCHAR2(5)   NOT NULL,
    IDATIVO          VARCHAR2(1)   DEFAULT 'S' NOT NULL,
    NRORG            NUMBER NOT NULL,
    DTINCLUSAO       DATE          DEFAULT SYSDATE,
    DTULTATU         DATE          DEFAULT SYSDATE,
    NRORGINCLUSAO    NUMBER,
    CDOPERINCLUSAO   VARCHAR2(12),
    NRORGULTATU      NUMBER,
    CDOPERULTATU     VARCHAR2(12), 
		CONSTRAINT PK_INFORMATIVOECOMSILE PRIMARY KEY(ID),
		CONSTRAINT CKC_IDATIVO_INFORECOMSILE CHECK (IDATIVO IN ('S','N'))
)
/

ALTER TABLE INFORMATIVOECOMMERCE ADD CDPUBLICOALVO VARCHAR2(1)
/
ALTER TABLE INFORMATIVOECOMMERCE ADD MARKISREAD VARCHAR2(1)
/

CREATE TABLE INFORMATIVOECOMSILEOPER  (
    ID                  NUMBER        NOT NULL,
    CDOPERADOR          VARCHAR2(12)  NOT NULL,
    CDPUBLICOALVO       VARCHAR2(1)   NOT NULL,
    DTINFOSILE          DATE          NOT NULL,
    IDATIVO             VARCHAR2(1)   DEFAULT 'S' NOT NULL,
    NRORG               NUMBER        NOT NULL,
    DTINCLUSAO          DATE          DEFAULT SYSDATE,
    DTULTATU            DATE          DEFAULT SYSDATE,
    NRORGINCLUSAO       NUMBER      ,
    CDOPERINCLUSAO      VARCHAR2(12),
    NRORGULTATU         NUMBER      ,
    CDOPERULTATU        VARCHAR2(12),
    MARKISREAD          VARCHAR2(1),
		CONSTRAINT PK_INFORMATIVOECOMSILEOPER PRIMARY KEY(ID),
		CONSTRAINT CKC_IDATIVO_INFORECOMSILEOPER CHECK (IDATIVO IN ('S','N')),
		CONSTRAINT FK_INFORMATIVOECOMSILEOPER FOREIGN KEY (CDOPERADOR) REFERENCES OPERADOR(CDOPERADOR)
)
/