diff --git a/dmp-db-scema/updates/05/External_References_Reference_Prefix_Update.sql b/dmp-db-scema/updates/05/External_References_Reference_Prefix_Update.sql new file mode 100644 index 000000000..57df26e86 --- /dev/null +++ b/dmp-db-scema/updates/05/External_References_Reference_Prefix_Update.sql @@ -0,0 +1,31 @@ +-- Registry Update Script +UPDATE public."Registry" +SET "Reference" = REPLACE("Reference", 'dmpdata/', 'dmp:') +WHERE "Reference" LIKE 'dmpdata/%'; + +-- Service Update Script +UPDATE public."Service" +SET "Reference" = REPLACE("Reference", 'dmpdata/', 'dmp:') +WHERE "Reference" LIKE 'dmpdata/%'; +UPDATE public."Service" +SET "Reference" = REPLACE("Reference", 'innerdata/', 'dmp:') +WHERE "Reference" LIKE 'innerdata/%' + +-- DataRepository +UPDATE public."DataRepository" +SET "Reference" = REPLACE("Reference", 'dmpdata/', 'dmp:') +where "Reference" like 'dmpdata/%'; +UPDATE public."DataRepository" +SET "Reference" = CONCAT('re3data:', "Reference") +where "Reference" LIKE '%:re3data%'; +UPDATE public."DataRepository" +SET "Reference" = CONCAT('dmp:', "Reference") +where "Reference" LIKE '%:internal%'; +UPDATE public."DataRepository" +SET "Reference" = CONCAT('eestore:', "Reference") +where "Reference" LIKE '%:eestore%'; + +-- ExternalDataset +UPDATE public."ExternalDataset" +SET "Reference" = REPLACE("Reference", 'dmpdata/', 'dmp:') +WHERE "Reference" LIKE 'dmpdata/%' \ No newline at end of file