BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0783', :eg_version); -- gmcharlt/dbs
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0784', :eg_version); -- Callender/berick
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
--- /dev/null
+-- Evergreen DB patch XXXX.function.axis_authority_tags_refs_aggregate.sql
+--
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0784', :eg_version);
+
+CREATE OR REPLACE FUNCTION authority.axis_authority_tags_refs(a TEXT) RETURNS INT[] AS $$
+ SELECT ARRAY_AGG(y) from (
+ SELECT unnest(ARRAY_CAT(
+ ARRAY[a.field],
+ (SELECT ARRAY_ACCUM(x.id) FROM authority.control_set_authority_field x WHERE x.main_entry = a.field)
+ )) y
+ FROM authority.browse_axis_authority_field_map a
+ WHERE axis = $1) x;
+$$ LANGUAGE SQL;
+
+CREATE OR REPLACE FUNCTION authority.btag_authority_tags_refs(btag TEXT) RETURNS INT[] AS $$
+ SELECT ARRAY_AGG(y) from (
+ SELECT unnest(ARRAY_CAT(
+ ARRAY[a.authority_field],
+ (SELECT ARRAY_ACCUM(x.id) FROM authority.control_set_authority_field x WHERE x.main_entry = a.authority_field)
+ )) y
+ FROM authority.control_set_bib_field a
+ WHERE a.tag = $1) x
+$$ LANGUAGE SQL;
+
+CREATE OR REPLACE FUNCTION authority.atag_authority_tags_refs(atag TEXT) RETURNS INT[] AS $$
+ SELECT ARRAY_AGG(y) from (
+ SELECT unnest(ARRAY_CAT(
+ ARRAY[a.id],
+ (SELECT ARRAY_ACCUM(x.id) FROM authority.control_set_authority_field x WHERE x.main_entry = a.id)
+ )) y
+ FROM authority.control_set_authority_field a
+ WHERE a.tag = $1) x
+$$ LANGUAGE SQL;
+
+
+COMMIT;
+++ /dev/null
--- Evergreen DB patch XXXX.function.axis_authority_tags_refs_aggregate.sql
---
-BEGIN;
-
--- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-CREATE OR REPLACE FUNCTION authority.axis_authority_tags_refs(a TEXT) RETURNS INT[] AS $$
- SELECT ARRAY_AGG(y) from (
- SELECT unnest(ARRAY_CAT(
- ARRAY[a.field],
- (SELECT ARRAY_ACCUM(x.id) FROM authority.control_set_authority_field x WHERE x.main_entry = a.field)
- )) y
- FROM authority.browse_axis_authority_field_map a
- WHERE axis = $1) x;
-$$ LANGUAGE SQL;
-
-CREATE OR REPLACE FUNCTION authority.btag_authority_tags_refs(btag TEXT) RETURNS INT[] AS $$
- SELECT ARRAY_AGG(y) from (
- SELECT unnest(ARRAY_CAT(
- ARRAY[a.authority_field],
- (SELECT ARRAY_ACCUM(x.id) FROM authority.control_set_authority_field x WHERE x.main_entry = a.authority_field)
- )) y
- FROM authority.control_set_bib_field a
- WHERE a.tag = $1) x
-$$ LANGUAGE SQL;
-
-CREATE OR REPLACE FUNCTION authority.atag_authority_tags_refs(atag TEXT) RETURNS INT[] AS $$
- SELECT ARRAY_AGG(y) from (
- SELECT unnest(ARRAY_CAT(
- ARRAY[a.id],
- (SELECT ARRAY_ACCUM(x.id) FROM authority.control_set_authority_field x WHERE x.main_entry = a.id)
- )) y
- FROM authority.control_set_authority_field a
- WHERE a.tag = $1) x
-$$ LANGUAGE SQL;
-
-
-COMMIT;