[open-ils-commits] r16319 - 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 Apr 27 12:23:22 EDT 2010
Author: scottmk
Date: 2010-04-27 12:23:19 -0400 (Tue, 27 Apr 2010)
New Revision: 16319
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0241.schema.acq-po-item.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:
Add acq.po_item table.
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/0241.schema.acq-po-item.sql
M Open-ILS/examples/fm_IDL.xml
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2010-04-27 12:46:51 UTC (rev 16318)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-04-27 16:23:19 UTC (rev 16319)
@@ -5426,6 +5426,28 @@
</permacrud>
</class>
+ <class id="acqpoi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::po_item" oils_persist:tablename="acq.po_item" reporter:label="Purchase Order Item">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
+ <field reporter:label="ID" name="id" reporter:datatype="id"/>
+ <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
+ <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
+ <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
+ <field reporter:label="Title" name="title" reporter:datatype="text"/>
+ <field reporter:label="Author" name="author" reporter:datatype="text"/>
+ <field reporter:label="Note" name="note" reporter:datatype="text"/>
+ <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
+ <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
+ </fields>
+ <links>
+ <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
+ <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
+ <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
+ <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ </permacrud>
+ </class>
+
<class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
<fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
<field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-04-27 12:46:51 UTC (rev 16318)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-04-27 16:23:19 UTC (rev 16319)
@@ -60,7 +60,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0240'); -- senator
+INSERT INTO config.upgrade_log (version) VALUES ('0241'); -- 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-04-27 12:46:51 UTC (rev 16318)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-04-27 16:23:19 UTC (rev 16319)
@@ -843,6 +843,24 @@
amount_paid NUMERIC (8,2)
);
+CREATE TABLE acq.po_item (
+ id SERIAL PRIMARY KEY,
+ purchase_order INT REFERENCES acq.purchase_order (id)
+ ON UPDATE CASCADE ON DELETE SET NULL
+ DEFERRABLE INITIALLY DEFERRED,
+ fund_debit INT REFERENCES acq.fund_debit (id)
+ DEFERRABLE INITIALLY DEFERRED,
+ inv_item_type TEXT NOT NULL
+ REFERENCES acq.invoice_item_type (code)
+ DEFERRABLE INITIALLY DEFERRED,
+ title TEXT,
+ author TEXT,
+ note TEXT,
+ estimated_cost NUMERIC(8,2),
+ fund INT REFERENCES acq.fund (id)
+ DEFERRABLE INITIALLY DEFERRED
+);
+
-- Patron requests
CREATE TABLE acq.user_request_type (
id SERIAL PRIMARY KEY,
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0241.schema.acq-po-item.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0241.schema.acq-po-item.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0241.schema.acq-po-item.sql 2010-04-27 16:23:19 UTC (rev 16319)
@@ -0,0 +1,23 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0241'); -- Scott McKellar
+
+CREATE TABLE acq.po_item (
+ id SERIAL PRIMARY KEY,
+ purchase_order INT REFERENCES acq.purchase_order (id)
+ ON UPDATE CASCADE ON DELETE SET NULL
+ DEFERRABLE INITIALLY DEFERRED,
+ fund_debit INT REFERENCES acq.fund_debit (id)
+ DEFERRABLE INITIALLY DEFERRED,
+ inv_item_type TEXT NOT NULL
+ REFERENCES acq.invoice_item_type (code)
+ DEFERRABLE INITIALLY DEFERRED,
+ title TEXT,
+ author TEXT,
+ note TEXT,
+ estimated_cost NUMERIC(8,2),
+ fund INT REFERENCES acq.fund (id)
+ DEFERRABLE INITIALLY DEFERRED
+);
+
+COMMIT;
More information about the open-ils-commits
mailing list