File tree Expand file tree Collapse file tree
mod-record-specifications-server/src/main/resources/db/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ -- Script for https://folio-org.atlassian.net/browse/MRSPECS-202
2+
3+ -- Replace ${tenantId} placeholder with specific tenant id
4+ SET SEARCH_PATH = ${tenantId}_mod_record_specifications;
5+
6+ -- Update field '590' to be non-deprecated and set scope to LOCAL in MARC bibliographic specification
7+ WITH updated_field AS (
8+ UPDATE field f
9+ SET deprecated = false,
10+ scope = ' LOCAL'
11+ FROM specification s
12+ WHERE f .specification_id = s .id
13+ AND f .tag = ' 590'
14+ AND s .family = ' MARC' ::family_enum
15+ AND s .profile = ' BIBLIOGRAPHIC' ::family_profile_enum
16+ RETURNING f .id
17+ ),
18+ -- Update subfields of field '590' to set scope to LOCAL and make subfield 'd' repeatable
19+ updated_subfield AS (
20+ UPDATE subfield sf
21+ SET scope = ' LOCAL' ,
22+ repeatable = CASE
23+ WHEN sf .code = ' d' THEN true
24+ ELSE repeatable
25+ END
26+ FROM updated_field f
27+ WHERE sf .field_id = f .id
28+ RETURNING 1
29+ )
30+ -- Update indicator codes of field '590' to set scope to LOCAL
31+ UPDATE indicator_code ic
32+ SET scope = ' LOCAL'
33+ FROM indicator i, updated_field f
34+ WHERE ic .indicator_id = i .id
35+ AND i .field_id = f .id ;
You can’t perform that action at this time.
0 commit comments