[open-ils-commits] r15977 - 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
Thu Mar 25 12:03:51 EDT 2010
Author: scottmk
Date: 2010-03-25 12:03:48 -0400 (Thu, 25 Mar 2010)
New Revision: 15977
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0211.schema.acq.replace-claim-interval.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:
Replace acq.lineitem.claim_interval and acq.provider.default_claim_interval
with foreign keys pointing to the new acq.claim_policy 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/0211.schema.acq.replace-claim-interval.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-25 14:10:55 UTC (rev 15976)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-03-25 16:03:48 UTC (rev 15977)
@@ -4490,13 +4490,14 @@
<field reporter:label="Email" name="email" reporter:datatype="text" />
<field reporter:label="Phone" name="phone" reporter:datatype="text" />
<field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
- <field reporter:label="Default Claim Interval" name="default_claim_interval" reporter:datatype="interval" />
+ <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
</fields>
<links>
<link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
<link field="owner" reltype="has_a" key="id" map="" class="aou"/>
<link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
<link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
+ <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
@@ -5254,7 +5255,7 @@
<field reporter:label="State" name="state" reporter:datatype="text" />
<field reporter:label="Creator" name="creator" reporter:datatype="link" />
<field reporter:label="Editor" name="editor" reporter:datatype="link" />
- <field reporter:label="Claim Interval" name="claim_interval" reporter:datatype="interval" />
+ <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
<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" />
@@ -5276,6 +5277,7 @@
<link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
<link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
<link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
+ <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-03-25 14:10:55 UTC (rev 15976)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-03-25 16:03:48 UTC (rev 15977)
@@ -59,7 +59,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0210'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0211'); -- 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-25 14:10:55 UTC (rev 15976)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-03-25 16:03:48 UTC (rev 15977)
@@ -44,7 +44,8 @@
email TEXT,
phone TEXT,
fax_phone TEXT,
- default_claim_interval INTERVAL,
+ default_claim_policy INT REFERENCES acq.claim_policy
+ DEFERRABLE INITIALLY DEFERRED,
CONSTRAINT provider_name_once_per_owner UNIQUE (name,owner),
CONSTRAINT code_once_per_owner UNIQUE (code, owner)
);
@@ -453,10 +454,11 @@
eg_bib_id INT REFERENCES biblio.record_entry (id) DEFERRABLE INITIALLY DEFERRED,
source_label TEXT,
state TEXT NOT NULL DEFAULT 'new',
- claim_interval INTERVAL,
cancel_reason INT REFERENCES acq.cancel_reason( id )
DEFERRABLE INITIALLY DEFERRED,
estimated_unit_price NUMERIC,
+ claim_policy INT REFERENCES acq.claim_policy
+ DEFERRABLE INITIALLY DEFERRED,
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/0211.schema.acq.replace-claim-interval.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0211.schema.acq.replace-claim-interval.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0211.schema.acq.replace-claim-interval.sql 2010-03-25 16:03:48 UTC (rev 15977)
@@ -0,0 +1,21 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0211'); -- Scott McKellar
+
+ALTER TABLE acq.lineitem
+ DROP COLUMN claim_interval;
+
+ALTER TABLE acq.lineitem
+ ADD COLUMN claim_policy INT
+ REFERENCES acq.claim_policy
+ DEFERRABLE INITIALLY DEFERRED;
+
+ALTER TABLE acq.provider
+ DROP COLUMN default_claim_interval;
+
+ALTER TABLE acq.provider
+ ADD COLUMN default_claim_policy INT
+ REFERENCES acq.claim_policy
+ DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;
More information about the open-ils-commits
mailing list