SQL script for the update of "reference" property of Grant, Funder and Project. (Issue #187)

This commit is contained in:
gkolokythas 2019-11-06 16:49:22 +02:00
parent bb76a0527e
commit 59cb4db641
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
-- 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:%');