-- Grant
UPDATE public."Grant"
SET "Reference" = CONCAT('cristin:', "Reference")
WHERE "Reference" LIKE '%cristin/%';
UPDATE public."Grant"
SET "Reference" = CONCAT('OpenAIRE:', "Reference")
where "Reference" like '%_________::%' and
"Reference" not like 'OpenAIRE:%';

-- Funder
UPDATE public."Funder"
SET "Reference" = CONCAT('cristin:', "Reference")
WHERE "Reference" LIKE '%cristin/%';
UPDATE public."Funder"
SET "Reference" = CONCAT('openaire:', "Reference")
WHERE "Reference" LIKE '%_________::%' and
upper("Reference") NOT LIKE upper('openAIRE:%');

-- Project
UPDATE public."Project"
SET "Reference" = CONCAT('cristin:', "Reference")
WHERE "Reference" LIKE '%cristin/%';
UPDATE public."Project"
SET "Reference" = CONCAT('openaire:', "Reference")
WHERE "Reference" LIKE '%_________::%' and
upper("Reference") NOT LIKE upper('openAIRE:%');