From: Jason Stephenson Date: Fri, 7 Jun 2013 14:31:30 +0000 (-0400) Subject: Fix problem with YYYY.schema.bib-auth-browse.sql. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9d37f6890ce6b591d62972ce3e341cecf7c45535;p=evergreen%2Fequinox.git Fix problem with YYYY.schema.bib-auth-browse.sql. 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 Signed-off-by: Kathy Lussier Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/sql/Pg/upgrade/YYYY.schema.bib-auth-browse.sql b/Open-ILS/src/sql/Pg/upgrade/YYYY.schema.bib-auth-browse.sql index 66c8fcbbc4..e441641053 100644 --- a/Open-ILS/src/sql/Pg/upgrade/YYYY.schema.bib-auth-browse.sql +++ b/Open-ILS/src/sql/Pg/upgrade/YYYY.schema.bib-auth-browse.sql @@ -3,6 +3,11 @@ BEGIN; -- 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; @@ -12,6 +17,9 @@ UPDATE authority.control_set_authority_field 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;