Skip to content

Commit 7627ef9

Browse files
authored
chore: add script for update 856 subfields for bibliographic specification (#155)
Closes: MRSPECS-97
1 parent 63e828a commit 7627ef9

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
-- Replace ${tenantId} placeholder with specific tenant id
2+
-- Script for https://folio-org.atlassian.net/browse/MRSPECS-97
3+
SET SEARCH_PATH = ${tenantId}_mod_record_specifications;
4+
5+
-- Update subfield with codes 'g', 'h', 'l', 'n', 'r', 't' related to field '856' in MARC bibliographic specification
6+
UPDATE subfield
7+
SET
8+
label = CASE code
9+
WHEN 'g' THEN 'Persistent identifier'
10+
WHEN 'h' THEN 'Non-functioning Uniform Resource Identifier'
11+
WHEN 'l' THEN 'Standardized information governing access'
12+
WHEN 'n' THEN 'Terms governing access'
13+
WHEN 'r' THEN 'Standardized information governing use and reproduction'
14+
WHEN 't' THEN 'Terms governing use and reproduction'
15+
ELSE label
16+
END,
17+
repeatable = true,
18+
required = false,
19+
deprecated = false
20+
WHERE code IN ('g', 'h', 'l', 'n', 'r', 't')
21+
AND field_id IN (
22+
SELECT f.id
23+
FROM field f
24+
JOIN specification s ON f.specification_id = s.id
25+
WHERE f.tag = '856'
26+
AND s.family = 'MARC'::family_enum
27+
AND s.profile = 'BIBLIOGRAPHIC'::family_profile_enum
28+
);
29+

0 commit comments

Comments
 (0)