
/*------ ATD 472432 ------*/
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'AcompanhamentoBoleto' and column_name = 'ProtocoloEmail')
    ALTER TABLE AcompanhamentoBoleto ADD ProtocoloEmail VARCHAR(254)
go
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'AcompanhamentoBoleto' and column_name = 'ProtocoloImpressao')
    ALTER TABLE AcompanhamentoBoleto ADD ProtocoloImpressao VARCHAR(254)
go

IF NOT EXISTS (SELECT 1 FROM sys.indexes I JOIN  sys.objects o ON i.object_id = o.object_id WHERE O.name = 'AcompanhamentoBoleto' and i.name = 'IDX_ACOMPANHAMENTOBOLETO_CR_HIS')
	CREATE INDEX IDX_ACOMPANHAMENTOBOLETO_CR_HIS ON ACOMPANHAMENTOBOLETO(RCONTAARECEBER,HISTORICO)
go
