From 06ae4d63a7735eadbaa57cbfd182a226b5cff4d2 Mon Sep 17 00:00:00 2001 From: scottmk Date: Thu, 23 Sep 2010 15:22:29 +0000 Subject: [PATCH] Drop the never-used column item_count from acq.lineitem. Drop it also from the associated history table, and rebuild the function that maintains it. Finally, rebuild the associated lifecycle view. Apply to trunk only; this column never existed in 2.0. The column has already been removed from the base installation script. M Open-ILS/src/sql/Pg/002.schema.config.sql A Open-ILS/src/sql/Pg/upgrade/0417.schema.acq.drop-lineitem-item-count.sql git-svn-id: svn://svn.open-ils.org/ILS/trunk@17918 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- .../0417.schema.acq.drop-lineitem-item-count.sql | 23 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0417.schema.acq.drop-lineitem-item-count.sql diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 6f4c362e7..65bcaba39 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -70,7 +70,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0416'); -- Scott McKellar +INSERT INTO config.upgrade_log (version) VALUES ('0417'); -- Scott McKellar CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/0417.schema.acq.drop-lineitem-item-count.sql b/Open-ILS/src/sql/Pg/upgrade/0417.schema.acq.drop-lineitem-item-count.sql new file mode 100644 index 000000000..aadf5fafa --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0417.schema.acq.drop-lineitem-item-count.sql @@ -0,0 +1,23 @@ +-- Drop the never-used column item_count from acq.lineitem. +-- Drop it also from the associated history table, and rebuild +-- the function that maintains it. Finally, rebuild the +-- associated lifecycle view. + +-- Apply to trunk only; this column never existed in 2.0. + +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0417'); -- Scott McKellar + +-- Have to drop the view first, because it's a dependent +DROP VIEW IF EXISTS acq.acq_lineitem_lifecycle; + +ALTER TABLE acq.lineitem DROP COLUMN item_count; + +ALTER TABLE acq.acq_lineitem_history DROP COLUMN item_count; + +SELECT acq.create_acq_func( 'acq', 'lineitem' ); + +SELECT acq.create_acq_lifecycle( 'acq', 'lineitem' ); + +COMMIT; -- 2.11.0