/
Copy of Script for Identifying Item Records that Have Invalid itemLevelCallNumberTypeId Types
Copy of Script for Identifying Item Records that Have Invalid itemLevelCallNumberTypeId Types
Before MODINVSTOR-987 was released, It was possible to set itemLevelCallNumberTypeId values for items that are invalid UUIDs or do not refer to a known call number type.
This script helps identify the records that would become invalid when this change is made so the records can be fixed prior to rolling out the change. the records would need to be manually updated either through the UI or via calls to the relevant API.
SET search_path TO {tenant}_mod_inventory_storage; SELECT item.id AS "item id", item.jsonb ->> 'itemLevelCallNumberTypeId' AS "Call Number Type ID" FROM item LEFT JOIN call_number_type ON CASE WHEN item.jsonb->>'itemLevelCallNumberTypeId' ~* '^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$' THEN (item.jsonb->>'itemLevelCallNumberTypeId')::uuid = call_number_type.id ELSE false END WHERE item.jsonb ->> 'itemLevelCallNumberTypeId' IS NOT NULL
AND call_number_type.id IS NULL;
Where {tenant} - the owner (tenant) for which you want to run the report.
, multiple selections available,
Related content
Scripts for Inventory, Source Record Storage, and Data Import Cleanup
Scripts for Inventory, Source Record Storage, and Data Import Cleanup
More like this
[Jira Tickets created] Drafts UI - Inventory: Filter Item Records by Call Number
[Jira Tickets created] Drafts UI - Inventory: Filter Item Records by Call Number
More like this
Inventory Audit log/Version History
Inventory Audit log/Version History
More like this
Harvested Inventory Data
Harvested Inventory Data
More like this
Call number browse refactor: UAT scenarios
Call number browse refactor: UAT scenarios
More like this
[Jira Ticket created] Drafts UI - Inventory: Add Additional Call Numbers to Items Records
[Jira Ticket created] Drafts UI - Inventory: Add Additional Call Numbers to Items Records
More like this