ALTER TABLE permission.grp_tree
ADD COLUMN hold_priority INT NOT NULL DEFAULT 0;
--- 0430
-ALTER TABLE config.hold_matrix_matchpoint ADD COLUMN strict_ou_match BOOL NOT NULL DEFAULT FALSE;
+-- 0430, and parts of others
+-- Hold matchpoint table changes combined
+ALTER TABLE config.hold_matrix_matchpoint
+ ADD COLUMN strict_ou_match BOOL NOT NULL DEFAULT FALSE,
+ ADD COLUMN marc_bib_level text,
+ DROP CONSTRAINT hous_once_per_grp_loc_mod_marc,
+ DROP CONSTRAINT hold_matrix_matchpoint_marc_form_fkey,
+ DROP CONSTRAINT hold_matrix_matchpoint_marc_type_fkey,
+ DROP CONSTRAINT hold_matrix_matchpoint_marc_vr_format_fkey;
-- Replace all uses of PostgreSQL's built-in LOWER() function with
-- a more locale-savvy PLPERLU evergreen.lowercase() function
DROP CONSTRAINT circ_matrix_matchpoint_marc_type_fkey,
DROP CONSTRAINT circ_matrix_matchpoint_marc_vr_format_fkey;
-ALTER TABLE config.hold_matrix_matchpoint
- DROP CONSTRAINT hous_once_per_grp_loc_mod_marc;
-
-- Clean up tables before making normalized index
CREATE OR REPLACE FUNCTION action.cleanup_matrix_matchpoints() RETURNS void AS $func$
ALTER TABLE config.i18n_locale DROP CONSTRAINT i18n_locale_marc_code_fkey;
-ALTER TABLE config.hold_matrix_matchpoint DROP CONSTRAINT hold_matrix_matchpoint_marc_form_fkey;
-ALTER TABLE config.hold_matrix_matchpoint DROP CONSTRAINT hold_matrix_matchpoint_marc_type_fkey;
-ALTER TABLE config.hold_matrix_matchpoint DROP CONSTRAINT hold_matrix_matchpoint_marc_vr_format_fkey;
-
DROP TABLE config.language_map;
DROP TABLE config.bib_level_map;
DROP TABLE config.item_form_map;
ALTER TABLE config.hold_matrix_weights ALTER COLUMN marc_bib_level DROP DEFAULT;
-ALTER TABLE config.hold_matrix_matchpoint ADD COLUMN marc_bib_level text;
-
CREATE OR REPLACE FUNCTION action.find_circ_matrix_matchpoint( context_ou INT, item_object asset.copy, user_object actor.usr, renewal BOOL ) RETURNS action.found_circ_matrix_matchpoint AS $func$
DECLARE
cn_object asset.call_number%ROWTYPE;