From 1544a5cade9e541c3d3544f45580cb34d3e7914b Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Fri, 1 Jul 2016 16:56:54 +0300 Subject: [PATCH] Update notes for 2016-07-01 --- content/2016-06.md | 2 +- content/2016-07.md | 10 ++++++++++ public/2016-06/index.html | 2 +- public/2016-07/index.html | 9 +++++++++ public/index.html | 8 +++++++- public/index.xml | 11 ++++++++++- public/tags/notes/index.html | 8 +++++++- public/tags/notes/index.xml | 11 ++++++++++- 8 files changed, 55 insertions(+), 6 deletions(-) diff --git a/content/2016-06.md b/content/2016-06.md index ab506c3ef..e60cdefd6 100644 --- a/content/2016-06.md +++ b/content/2016-06.md @@ -279,7 +279,7 @@ $ ./delete-metadata-values.py -f dc.contributor.corporate -i Corporate-Authors-D - Wow, there are 95 authors in the database who have ',' at the end of their name: ``` -#select text_value from metadatavalue where metadata_field_id=3 and text_value like '%,'; +# select text_value from metadatavalue where metadata_field_id=3 and text_value like '%,'; ``` - We need to use something like this to fix them, need to write a proper regex later: diff --git a/content/2016-07.md b/content/2016-07.md index a263642b0..498719a24 100644 --- a/content/2016-07.md +++ b/content/2016-07.md @@ -9,3 +9,13 @@ image = "../images/bg.jpg" ## 2016-07-01 - Add `dc.description.sponsorship` to Discovery sidebar facets and make investors clickable in item view ([#232](https://github.com/ilri/DSpace/issues/232)) +- I think this query should find and replace all authors that have "," at the end of their names (there were 95 matching the select before): + +``` +dspacetest=# update metadatavalue set text_value = regexp_replace(text_value, '(^.+?),$', '\1') where metadata_field_id=3 and text_value ~ '^.+?,$'; +UPDATE 95 +dspacetest=# select text_value from metadatavalue where metadata_field_id=3 and text_value ~ '^.+?,$'; + text_value +------------ +(0 rows) +``` diff --git a/public/2016-06/index.html b/public/2016-06/index.html index b488d3fe8..eb330ce1f 100644 --- a/public/2016-06/index.html +++ b/public/2016-06/index.html @@ -413,7 +413,7 @@ $ ./delete-metadata-values.py -f dc.contributor.corporate -i Corporate-Authors-D
  • Wow, there are 95 authors in the database who have ‘,’ at the end of their name:
  • -
    #select text_value from  metadatavalue where metadata_field_id=3 and text_value like '%,';
    +
    # select text_value from  metadatavalue where metadata_field_id=3 and text_value like '%,';
     
      diff --git a/public/2016-07/index.html b/public/2016-07/index.html index 0ef8d6268..e5f63ff53 100644 --- a/public/2016-07/index.html +++ b/public/2016-07/index.html @@ -83,8 +83,17 @@
      • Add dc.description.sponsorship to Discovery sidebar facets and make investors clickable in item view (#232)
      • +
      • I think this query should find and replace all authors that have “,” at the end of their names (there were 95 matching the select before):
      +
      dspacetest=# update metadatavalue set text_value = regexp_replace(text_value, '(^.+?),$', '\1') where metadata_field_id=3 and text_value ~ '^.+?,$';
      +UPDATE 95
      +dspacetest=# select text_value from  metadatavalue where metadata_field_id=3 and text_value ~ '^.+?,$';
      + text_value
      +------------
      +(0 rows)
      +
      +