From bba57db7c384059f5177ca2b08b9d4c5d25fdcb0 Mon Sep 17 00:00:00 2001 From: imerabishvili <144257054+imerabishvili@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:26:47 +0400 Subject: [PATCH] =?UTF-8?q?CIRCSTORE-553:=20Create=20script=20to=20update?= =?UTF-8?q?=20normalize=5Fisbns=20=C2=A0to=20have=20full=20schema=20path?= =?UTF-8?q?=20(#504)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/db_scripts/createIsbnFunctions.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/db_scripts/createIsbnFunctions.sql b/src/main/resources/templates/db_scripts/createIsbnFunctions.sql index 85e8a2a52..9092e3ad3 100644 --- a/src/main/resources/templates/db_scripts/createIsbnFunctions.sql +++ b/src/main/resources/templates/db_scripts/createIsbnFunctions.sql @@ -1,8 +1,8 @@ -- 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 normalize_isbns(jsonb_array jsonb) RETURNS text AS $$ - SELECT string_agg(normalize_digits(identifiers->>'value'), ' ') +CREATE OR REPLACE FUNCTION ${myuniversity}_${mymodule}.normalize_isbns(jsonb_array jsonb) RETURNS text AS $$ +SELECT string_agg(${myuniversity}_${mymodule}.normalize_digits(identifiers->>'value'), ' ') FROM jsonb_array_elements($1) as identifiers WHERE identifiers->>'identifierTypeId' = '8261054f-be78-422d-bd51-4ed9f33c3422'; $$ LANGUAGE sql IMMUTABLE PARALLEL SAFE STRICT;