LP#1470957: Normalize date1 (pubdate sorter) to null when not numeric
authorMike Rylander <mrylander@gmail.com>
Thu, 2 Jul 2015 18:44:25 +0000 (14:44 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 2 Mar 2016 21:41:54 +0000 (16:41 -0500)
commitd9348b9cc58c3b24ae435e2a4506195cef512e58
tree66346bc1cad1f088a1fdb7ee07823fa9b44b1907
parentb8eb0b6376e85fe99eddc0999cc86d83ce922aef
LP#1470957: Normalize date1 (pubdate sorter) to null when not numeric

We supply a normalizer function for making sure date-ish values are
always numeric (several, in fact) but we don't enable them by default
for appropriate fields.  This does that.

Additionally, we allow NULL sorters so that the reingest of a "broken"
record will get fixed.

We avoid the need for a reingest to cover the sorter issue by removing
non-numeric pubdate sorters.

To test
-------
[1] Identify some records where the Date1 value in the 008 field
    is '||||'.
[2] Perform a catalog search that includes some of those records
    and sort by publication date newest to oldest. Note that
    the |||| records sort at the top.
[3] Apply the patch and perform the schema update.
[4] Perform the search again (possibly clearing the search
    results cache first).  This time, the |||| records should
    sort near the end.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Jennifer Pringle <jennifer.pringle@bc.libraries.coop>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/sql/Pg/030.schema.metabib.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.normalize_pubdate_respect_null.sql [new file with mode: 0644]