Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Regarding comments from this ticket [MODSOURMAN-627] Kiwi bugfest - Data integrity issues with instances/holdings records - FOLIO Issue Tracker:a.

  1. If the holdings source is anything other than FOLIO or MARC (e.g. -), then change to FOLIO.

...

  1. If the holdings source = MARC, check to see if there is a linked SRS MARC Holdings record.
    1. If yes, then keep the Holdings source as MARC, and ensure that View source and Edit via QM

...

    1. in the Actions menu work for the Inventory Holdings record.
    2. If no, then

...

    1. change the Holdings source

...

    1. to FOLIO, and ensure that View source/Edit in QM do not display in the Inventory Holdings Action menu.


There were created scripts for retrieving these holdings. This is NOT update operationsThese scripts retrieve holdings that should be reviewed. These scripts DO NOT update those holdings. These scripts just show valid/invalid Holdings from DB by conditions from comment.


Script 1: Retrieve holdings where the source is anything other than FOLIO or MARC (e.g. -):

Code Block
languagesql
titleSelect Holdings where sourceName are not FOLIO and MARC
SELECT 
*
FROM ${tenant}_mod_inventory_storage.holdings_record
WHERE ${tenant}_mod_inventory_storage.holdings_record.jsonb ->> 'sourceId' = (
SELECT 
id::text
FROM ${tenant}_mod_inventory_storage.holdings_records_source
WHERE ${tenant}_mod_inventory_storage.holdings_records_source.jsonb ->> 'name' != 'FOLIO' AND
${tenant}_mod_inventory_storage.holdings_records_source.jsonb ->> 'name' != 'MARC');


Script 2. : Retrieve holdings where source= MARC and there is existing linked SRS MARC HOLDINGS record (by external_hrid) from records_lb from source-record-storage schema.

Code Block
languagesql
titleSelect Holdings where sourceName=MARC and external_hrid exists in SRS
SELECT * 
FROM ${tenant}_mod_inventory_storage.holdings_record RIGHT JOIN ${tenant}_mod_source_record_storage.records_lb
ON ${tenant}_mod_inventory_storage.holdings_record.jsonb->>'hrid' = ${tenant}_mod_source_record_storage.records_lb.external_hrid
WHERE ${tenant}_mod_inventory_storage.holdings_record.jsonb ->> 'sourceId' = (
SELECT 
id::text
FROM ${tenant}_mod_inventory_storage.holdings_records_source
WHERE ${tenant}_mod_inventory_storage.holdings_records_source.jsonb ->> 'name' = 'MARC');


Script 3. Retrieve : Retrieve holdings where source= MARC and there is NO existing SRS MARC HOLDINGS record (by external_hrid) from records_lb from source-record-storage schema.

...