ALTER TABLE TBHISTORICO
    ADD DATA DATE DEFAULT CURRENT_DATE NOT NULL;

CREATE INDEX ITBHISTORICO_05
ON TBHISTORICO (DATA);


ALTER TABLE TBPDV_DEVOLUCAO_TROCA
    ADD DATA DATE DEFAULT CURRENT_DATE NOT NULL;


CREATE INDEX ITBPDV_DEVOLUCAO_TROCA_11
ON TBPDV_DEVOLUCAO_TROCA (DATA);

UPDATE TBHISTORICO T SET T.DATA = CAST(T.DATAHORA AS DATE);

UPDATE TBPDV_DEVOLUCAO_TROCA T SET T.DATA = CAST(T.DATAHORA AS DATE);

ALTER TABLE TBPDV_CFE_ITEM
    ADD VENDEDOR_ID INTEGER DEFAULT 0 NOT NULL;

CREATE INDEX ITBPDV_CFE_ITEM_22
ON TBPDV_CFE_ITEM (VENDEDOR_ID);

ALTER TABLE TBCOR
ALTER COLUMN OBSERVACAO TYPE VARCHAR(2000);


ALTER TABLE TBNFS_ITEM
    ADD VENDEDOR_ID INTEGER DEFAULT 0 NOT NULL;


CREATE INDEX ITBNFS_ITEM_23
ON TBNFS_ITEM (VENDEDOR_ID);

