Details
-
Bug
-
Status: Draft (View Workflow)
-
P3
-
Resolution: Unresolved
-
None
-
None
-
None
-
Core: Platform
-
TBD
Description
Please check if ${myuniversity}_${mymodule} before normalize_digits can/should be removed. See https://github.com/folio-org/mod-inventory-storage/blob/v25.0.1/src/main/resources/templates/db_scripts/createIsbnFunctions.sql#L5 and https://github.com/folio-org/mod-inventory-storage/blob/v25.0.1/src/main/resources/templates/db_scripts/createIsbnFunctions.sql#L14 in the same file.
-- Usage: SELECT normalize_isbns(jsonb->'identifiers') FROM instance -- This takes each ISBN, normalizes it using RMB's normalize_digits(text), -- and concatenates the results using a space as separator. CREATE OR REPLACE FUNCTION ${myuniversity}_${mymodule}.normalize_isbns(jsonb_array jsonb) RETURNS text AS $$ SELECT string_agg(${myuniversity}_${mymodule}.normalize_digits(identifier->>'value'), ' ') FROM jsonb_array_elements($1) as identifier WHERE identifier->>'identifierTypeId' = '8261054f-be78-422d-bd51-4ed9f33c3422'; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT; -- Usage: SELECT normalize_invalid_isbns(jsonb->'identifiers') FROM instance -- This takes each invalid ISBN, normalizes it using RMB's normalize_digits(text), -- and concatenates the results using a space as separator. CREATE OR REPLACE FUNCTION ${myuniversity}_${mymodule}.normalize_invalid_isbns(jsonb_array jsonb) RETURNS text AS $$ SELECT string_agg(${myuniversity}_${mymodule}.normalize_digits(identifier->>'value'), ' ') FROM jsonb_array_elements($1) as identifier WHERE identifier->>'identifierTypeId' = 'fcca2643-406a-482a-b760-7a7f8aec640e'; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT;
TestRail: Results
Attachments
Issue Links
- relates to
-
CIRCSTORE-377 Schema name should not be embedded in sql function body
-
- Open
-
-
MODINVSTOR-474 Add "invalidIsbn" normalized index
-
- Closed
-