Disable ALL triggers on authority.control_set_authority_field before
altering and updating the table to avoid an error related to altering
a table with pending trigger events.
The triggers are enabled again after the updates and alters are done.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
-- check whether patch can be applied
-- SELECT evergreen.upgrade_deps_block_check('YYYY', :eg_version);
+-- To avoid problems with altering a table column after doing an
+-- update.
+ALTER TABLE authority.control_set_authority_field
+ DISABLE TRIGGER ALL;
+
ALTER TABLE authority.control_set_authority_field
ADD COLUMN display_sf_list TEXT;
ALTER TABLE authority.control_set_authority_field
ALTER COLUMN display_sf_list SET NOT NULL;
+ALTER TABLE authority.control_set_authority_field
+ ENABLE TRIGGER ALL;
+
ALTER TABLE metabib.browse_entry_def_map
ADD COLUMN authority BIGINT REFERENCES authority.record_entry (id)
ON DELETE SET NULL;