Update notes for 2017-02-16

This commit is contained in:
2017-02-16 19:41:58 +02:00
parent beaf2c0d81
commit b1c11adb57
5 changed files with 45 additions and 11 deletions

View File

@ -103,11 +103,17 @@ UPDATE 58193
- I noticed a few items that have incorrect DOI links (`dc.identifier.doi`), and after looking in the database I see there are over 100 that are missing the scheme or are just plain wrong:
```
dspace=# select distinct text_value from metadatavalue where resource_type_id=2 and metadata_field_id=220 and text_value not like 'http%://%';
dspace=# select distinct text_value from metadatavalue where resource_type_id=2 and metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = 'identifier' and qualifier = 'doi') and text_value not like 'http%://%';
```
- This will replace any that begin with `10.`:
- This will replace any that begin with `10.` and change them to `https://dx.doi.org/10.`:
```
dspace=# update metadatavalue set text_value = regexp_replace(text_value, '(^10\..+$)', 'https://dx.doi.org/\1') where metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = 'identifier' and qualifier = 'doi') and text_value like '10.%';
```
- This will get any that begin with `doi:10.` and change them to `https://dx.doi.org/10.x`:
```
dspace=# update metadatavalue set text_value = regexp_replace(text_value, '^doi:(10\..+$)', 'https://dx.doi.org/\1') where resource_type_id=2 and metadata_field_id IN (select metadata_field_id from metadatafieldregistry where element = 'identifier' and qualifier = 'doi') and text_value like 'doi:10%';
```