argos/dmp-db-scema/updates/05/Grant_Funder_Project_Refere...

26 lines
845 B
SQL

-- 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:%');