IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'ENVIA_TAG_DEMANDA' AND OBJECT_ID = OBJECT_ID('IQVIA_API_CONFIG'))
BEGIN
    ALTER TABLE IQVIA_API_CONFIG ADD ENVIA_TAG_DEMANDA INT NOT NULL DEFAULT 1;
END;

IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'ENVIA_TAG_PRESCRICAO' AND OBJECT_ID = OBJECT_ID('IQVIA_API_CONFIG'))
BEGIN
    ALTER TABLE IQVIA_API_CONFIG ADD ENVIA_TAG_PRESCRICAO INT NOT NULL DEFAULT 1;
END;

IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'ENVIA_TAG_TICKET' AND OBJECT_ID = OBJECT_ID('IQVIA_API_CONFIG'))
BEGIN
    ALTER TABLE IQVIA_API_CONFIG ADD ENVIA_TAG_TICKET INT NOT NULL DEFAULT 1;
END;

IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'ENVIA_TAG_CPP' AND OBJECT_ID = OBJECT_ID('IQVIA_API_CONFIG'))
BEGIN
    ALTER TABLE IQVIA_API_CONFIG ADD ENVIA_TAG_CPP INT NOT NULL DEFAULT 1;
END;

IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'ENVIA_TAG_PPP' AND OBJECT_ID = OBJECT_ID('IQVIA_API_CONFIG'))
BEGIN
    ALTER TABLE IQVIA_API_CONFIG ADD ENVIA_TAG_PPP INT NOT NULL DEFAULT 1;
END;

IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'ENVIA_TAG_ESTOQUE' AND OBJECT_ID = OBJECT_ID('IQVIA_API_CONFIG'))
BEGIN
    ALTER TABLE IQVIA_API_CONFIG ADD ENVIA_TAG_ESTOQUE INT NOT NULL DEFAULT 1;
END;

    