[open-ils-commits] r15767 - in trunk/Open-ILS: examples src/sql/Pg src/sql/Pg/upgrade (scottmk)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Mar 9 12:22:55 EST 2010
Author: scottmk
Date: 2010-03-09 12:22:52 -0500 (Tue, 09 Mar 2010)
New Revision: 15767
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0183.schema.acq-cancel-reason-history.sql
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
Log:
1. Add estimated_unit_price column to acq.lineitem.
2. Bring acq.acq_lineitem_history and acq.acq_purchase_order_history
into sync with their respective source tables.
M Open-ILS/src/sql/Pg/200.schema.acq.sql
M Open-ILS/src/sql/Pg/002.schema.config.sql
A Open-ILS/src/sql/Pg/upgrade/0183.schema.acq-cancel-reason-history.sql
M Open-ILS/examples/fm_IDL.xml
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2010-03-09 17:09:29 UTC (rev 15766)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-03-09 17:22:52 UTC (rev 15767)
@@ -5166,6 +5166,7 @@
<field reporter:label="State" name="state" reporter:datatype="text"/>
<field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
<field reporter:label="Name" name="name" reporter:datatype="text"/>
+ <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
</fields>
<links>
<link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
@@ -5174,6 +5175,7 @@
<link field="editor" reltype="has_a" key="id" map="" class="au"/>
<link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
<link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
+ <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
@@ -5229,6 +5231,7 @@
<field reporter:label="Editor" name="editor" reporter:datatype="link" />
<field reporter:label="Claim Interval" name="claim_interval" reporter:datatype="interval" />
<field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
+ <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
<field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
<field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
<field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
@@ -5245,7 +5248,7 @@
<link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
<link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
<link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
- <link field="cancel_reason" reltype="might_have" key="id" map="" class="acqcr"/>
+ <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
@@ -5275,6 +5278,9 @@
<field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
<field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
<field reporter:label="State" name="state" reporter:datatype="text"/>
+ <field reporter:label="Claim Interval" name="claim_interval" reporter:datatype="interval"/>
+ <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
+ <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
</fields>
<links>
<link field="id" reltype="has_a" key="id" map="" class="jub"/>
@@ -5285,6 +5291,7 @@
<link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
<link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
<link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
+ <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-03-09 17:09:29 UTC (rev 15766)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-03-09 17:22:52 UTC (rev 15767)
@@ -51,7 +51,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0182'); -- dbs
+INSERT INTO config.upgrade_log (version) VALUES ('0183'); -- Scott McKellar
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-03-09 17:09:29 UTC (rev 15766)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-03-09 17:22:52 UTC (rev 15767)
@@ -454,6 +454,7 @@
claim_interval INTERVAL,
cancel_reason INT REFERENCES acq.cancel_reason( id )
DEFERRABLE INITIALLY DEFERRED,
+ estimated_unit_price NUMERIC,
CONSTRAINT picklist_or_po CHECK (picklist IS NOT NULL OR purchase_order IS NOT NULL)
);
CREATE INDEX li_po_idx ON acq.lineitem (purchase_order);
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0183.schema.acq-cancel-reason-history.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0183.schema.acq-cancel-reason-history.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0183.schema.acq-cancel-reason-history.sql 2010-03-09 17:22:52 UTC (rev 15767)
@@ -0,0 +1,20 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0183'); -- Scott McKellar
+
+ALTER TABLE acq.lineitem
+ ADD COLUMN estimated_unit_price NUMERIC;
+
+ALTER TABLE acq.acq_lineitem_history
+ ADD COLUMN claim_interval INTERVAL;
+
+ALTER TABLE acq.acq_lineitem_history
+ ADD COLUMN cancel_reason INTEGER;
+
+ALTER TABLE acq.acq_lineitem_history
+ ADD COLUMN estimated_unit_price NUMERIC;
+
+ALTER TABLE acq.acq_purchase_order_history
+ ADD COLUMN cancel_reason INTEGER;
+
+COMMIT;
More information about the open-ils-commits
mailing list