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 33-- Replace ${tenantId} placeholder with specific tenant id
44SET SEARCH_PATH = ${tenantId}_mod_record_specifications;
55
6- -- Update field '590' to be non-deprecated and make its subfield 'd' repeatable in the MARC bibliographic specification.
6+ -- Update field '590' to be non-deprecated and set scope to LOCAL in MARC bibliographic specification
77WITH updated_field AS (
88 UPDATE field f
9- SET deprecated = false
9+ SET deprecated = false,
10+ scope = ' LOCAL'
1011 FROM specification s
1112 WHERE f .specification_id = s .id
1213 AND f .tag = ' 590'
1314 AND s .family = ' MARC' ::family_enum
1415 AND s .profile = ' BIBLIOGRAPHIC' ::family_profile_enum
1516 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
1629)
17- UPDATE subfield sf
18- SET repeatable = true
19- FROM updated_field f
20- WHERE sf .field_id = f .id
21- AND sf .code = ' d' ;
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