
/*------ ATD 489868 ------*/
-- Adicionando coluna FULFILLMENT na tabela PEDICLICOMPLEMENTO
DECLARE v_count NUMBER(1) := 0; 
BEGIN 
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE Upper(table_name) = 'PEDICLICOMPLEMENTO' AND Upper(column_name) = 'FULFILLMENT'; 
EXCEPTION 
WHEN NO_DATA_FOUND THEN 
EXECUTE IMMEDIATE 'ALTER TABLE PEDICLICOMPLEMENTO ADD FULFILLMENT INTEGER default 0 null '; 
END;

-- Adicionando coluna MARKETPLACE na tabela MU_CONFIGURACAO_IMPORTANFVENDA
DECLARE v_count NUMBER(1) := 0; 
BEGIN 
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE Upper(table_name) = 'MU_CONFIGURACAO_IMPORTANFVENDA' AND Upper(column_name) = 'MARKETPLACE'; 
EXCEPTION 
WHEN NO_DATA_FOUND THEN 
EXECUTE IMMEDIATE 'ALTER TABLE MU_CONFIGURACAO_IMPORTANFVENDA ADD MARKETPLACE VARCHAR(100) '; 
END;

-- Adicionando coluna PASTAIMPORTACAO na tabela MU_CONFIGURACAO_IMPORTANFVENDA
DECLARE v_count NUMBER(1) := 0; 
BEGIN 
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE Upper(table_name) = 'MU_CONFIGURACAO_IMPORTANFVENDA' AND Upper(column_name) = 'PASTAIMPORTACAO'; 
EXCEPTION 
WHEN NO_DATA_FOUND THEN 
EXECUTE IMMEDIATE 'ALTER TABLE MU_CONFIGURACAO_IMPORTANFVENDA ADD PASTAIMPORTACAO VARCHAR(254) '; 
END;

-- Adicionando coluna DEPOSITO na tabela MU_CONFIGURACAO_IMPORTANFVENDA
DECLARE v_count NUMBER(1) := 0; 
BEGIN 
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE Upper(table_name) = 'MU_CONFIGURACAO_IMPORTANFVENDA' AND Upper(column_name) = 'DEPOSITO'; 
EXCEPTION 
WHEN NO_DATA_FOUND THEN 
EXECUTE IMMEDIATE 'ALTER TABLE MU_CONFIGURACAO_IMPORTANFVENDA ADD DEPOSITO CHAR(2) '; 
END;

-- Adicionando coluna INATIVO na tabela MU_CONFIGURACAO_IMPORTANFVENDA
DECLARE v_count NUMBER(1) := 0; 
BEGIN 
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE Upper(table_name) = 'MU_CONFIGURACAO_IMPORTANFVENDA' AND Upper(column_name) = 'INATIVO'; 
EXCEPTION 
WHEN NO_DATA_FOUND THEN 
EXECUTE IMMEDIATE 'ALTER TABLE MU_CONFIGURACAO_IMPORTANFVENDA ADD INATIVO INT '; 
END;

-- Adicionando coluna ID_CONFIGURACAO na tabela MU_IMPORTANFVENDA
DECLARE v_count NUMBER(1) := 0; 
BEGIN 
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE Upper(table_name) = 'MU_IMPORTANFVENDA' AND Upper(column_name) = 'ID_CONFIGURACAO'; 
EXCEPTION 
WHEN NO_DATA_FOUND THEN 
EXECUTE IMMEDIATE 'ALTER TABLE MU_IMPORTANFVENDA ADD ID_CONFIGURACAO INT '; 
END;
