-- RM Consultas v5: documento original CRLV-e
ALTER TABLE consultas ADD COLUMN documento_pdf LONGBLOB NULL AFTER resposta_json;

INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco,ativo) VALUES
('CRLV-e AL','CRLV-e AL',0,39.90,1),
('CRLV-e AP','CRLV-e AP',0,39.90,1),
('CRLV-e MA','CRLV-e MA',0,39.90,1),
('CRLV-e MS','CRLV-e MS',0,39.90,1),
('CRLV-e PI','CRLV-e PI',0,39.90,1),
('CRLV-e PR','CRLV-e PR',0,39.90,1),
('CRLV-e RO','CRLV-e RO',0,39.90,1),
('CRLV-e RR','CRLV-e RR',0,39.90,1),
('CRLV-e SE','CRLV-e SE',0,39.90,1),
('CRLV-e TO','CRLV-e TO',0,39.90,1),
('CRLV-e MT','CRLV-e MT',0,39.90,1),
('CRLV-e GO','CRLV-e GO',0,39.90,1),
('CRLV-e MG','CRLV-e MG',0,39.90,1),
('CRLV-e SP','CRLV-e SP',0,39.90,1)
ON DUPLICATE KEY UPDATE nome=VALUES(nome), ativo=1;

-- v7: garantir todas as APIs CRLV-e documentadas pela UltraBusca
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e AC','CRLV-e AC',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e AC');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e AL','CRLV-e AL',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e AL');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e AM','CRLV-e AM',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e AM');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e AP','CRLV-e AP',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e AP');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e BA','CRLV-e BA',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e BA');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e CE','CRLV-e CE',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e CE');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e DF','CRLV-e DF',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e DF');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e GO','CRLV-e GO',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e GO');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e MA','CRLV-e MA',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e MA');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e MG','CRLV-e MG',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e MG');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e MS','CRLV-e MS',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e MS');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e MT','CRLV-e MT',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e MT');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e PB','CRLV-e PB',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e PB');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e PE','CRLV-e PE',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e PE');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e PI','CRLV-e PI',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e PI');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e PR','CRLV-e PR',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e PR');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e RJ','CRLV-e RJ',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e RJ');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e RN','CRLV-e RN',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e RN');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e RO','CRLV-e RO',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e RO');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e RR','CRLV-e RR',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e RR');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e RS','CRLV-e RS',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e RS');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e SC','CRLV-e SC',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e SC');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e SE','CRLV-e SE',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e SE');
INSERT INTO consultas_apis(nome,nome_fornecedor,custo,preco) SELECT 'CRLV-e TO','CRLV-e TO',0,39.90 WHERE NOT EXISTS (SELECT 1 FROM consultas_apis WHERE nome_fornecedor='CRLV-e TO');
