[open-ils-commits] r17918 - in trunk/Open-ILS/src/sql/Pg: . upgrade (scottmk)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Sep 23 11:22:32 EDT 2010


Author: scottmk
Date: 2010-09-23 11:22:29 -0400 (Thu, 23 Sep 2010)
New Revision: 17918

Added:
   trunk/Open-ILS/src/sql/Pg/upgrade/0417.schema.acq.drop-lineitem-item-count.sql
Modified:
   trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
Log:
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


Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-09-23 14:31:32 UTC (rev 17917)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-09-23 15:22:29 UTC (rev 17918)
@@ -70,7 +70,7 @@
     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,

Added: trunk/Open-ILS/src/sql/Pg/upgrade/0417.schema.acq.drop-lineitem-item-count.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0417.schema.acq.drop-lineitem-item-count.sql	                        (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0417.schema.acq.drop-lineitem-item-count.sql	2010-09-23 15:22:29 UTC (rev 17918)
@@ -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;



More information about the open-ils-commits mailing list