]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0417.schema.acq.drop-lineitem-item-count.sql
LP1079041 - making state not required (continued)
[working/Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0417.schema.acq.drop-lineitem-item-count.sql
1 -- Drop the never-used column item_count from acq.lineitem.
2 -- Drop it also from the associated history table, and rebuild
3 -- the function that maintains it.  Finally, rebuild the
4 -- associated lifecycle view.  
5
6 -- Apply to trunk only; this column never existed in 2.0.
7
8 BEGIN;
9
10 INSERT INTO config.upgrade_log (version) VALUES ('0417'); -- Scott McKellar
11
12 -- Have to drop the view first, because it's a dependent
13 DROP VIEW IF EXISTS acq.acq_lineitem_lifecycle;
14
15 ALTER TABLE acq.lineitem DROP COLUMN item_count;
16
17 ALTER TABLE acq.acq_lineitem_history DROP COLUMN item_count;
18
19 SELECT acq.create_acq_func( 'acq', 'lineitem' );
20
21 SELECT acq.create_acq_lifecycle( 'acq', 'lineitem' );
22
23 COMMIT;