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
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15977
dcc99617-32d9-48b4-a31d-
7c20da2025e4
<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>
<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" />
<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">
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,
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)
);
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);
--- /dev/null
+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;