[open-ils-commits] r15972 - 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 09:31:07 EDT 2010
Author: scottmk
Date: 2010-03-25 09:31:06 -0400 (Thu, 25 Mar 2010)
New Revision: 15972
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0210.schema.acq.claim-policy.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:
Create two tables in acq schema: claim_policy and claim_policy_action.
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/0210.schema.acq.claim-policy.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 13:19:57 UTC (rev 15971)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-03-25 13:31:06 UTC (rev 15972)
@@ -6034,6 +6034,35 @@
</permacrud>
</class>
+ <class id="acqclp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_policy" oils_persist:tablename="acq.claim_policy" reporter:label="Claim Policy">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
+ <field reporter:label="ID" name="id" reporter:datatype="id"/>
+ <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
+ <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
+ <field reporter:label="Description" name="description" reporter:datatype="text"/>
+ </fields>
+ <links>
+ <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ </permacrud>
+ </class>
+
+ <class id="acqclpa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_policy_action" oils_persist:tablename="acq.claim_policy_action" reporter:label="Claim Policy Action">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
+ <field reporter:label="ID" name="id" reporter:datatype="id"/>
+ <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
+ <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
+ <field reporter:label="Action" name="action" reporter:datatype="link"/>
+ </fields>
+ <links>
+ <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
+ <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ </permacrud>
+ </class>
+
<class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
<fields oils_persist:primary="row_id" oils_persist:sequence="staging.usr_stage_row_id_seq">
<field reporter:label="Row ID" name="row_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-03-25 13:19:57 UTC (rev 15971)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-03-25 13:31:06 UTC (rev 15972)
@@ -59,7 +59,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0209'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0210'); -- 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 13:19:57 UTC (rev 15971)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-03-25 13:31:06 UTC (rev 15972)
@@ -2499,4 +2499,24 @@
CREATE INDEX claim_event_claim_date_idx ON acq.claim_event( claim, event_date );
+CREATE TABLE acq.claim_policy (
+ id SERIAL PRIMARY KEY,
+ org_unit INT NOT NULL REFERENCES actor.org_unit
+ DEFERRABLE INITIALLY DEFERRED,
+ name TEXT NOT NULL,
+ description TEXT NOT NULL,
+ CONSTRAINT name_once_per_org UNIQUE (org_unit, name)
+);
+
+CREATE TABLE acq.claim_policy_action (
+ id SERIAL PRIMARY KEY,
+ claim_policy INT NOT NULL REFERENCES acq.claim_policy
+ ON DELETE CASCADE
+ DEFERRABLE INITIALLY DEFERRED,
+ action_interval INTERVAL NOT NULL,
+ action INT NOT NULL REFERENCES acq.claim_event_type
+ DEFERRABLE INITIALLY DEFERRED,
+ CONSTRAINT action_sequence UNIQUE (claim_policy, action_interval)
+);
+
COMMIT;
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0210.schema.acq.claim-policy.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0210.schema.acq.claim-policy.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0210.schema.acq.claim-policy.sql 2010-03-25 13:31:06 UTC (rev 15972)
@@ -0,0 +1,25 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0210'); -- Scott McKellar
+
+CREATE TABLE acq.claim_policy (
+ id SERIAL PRIMARY KEY,
+ org_unit INT NOT NULL REFERENCES actor.org_unit
+ DEFERRABLE INITIALLY DEFERRED,
+ name TEXT NOT NULL,
+ description TEXT NOT NULL,
+ CONSTRAINT name_once_per_org UNIQUE (org_unit, name)
+);
+
+CREATE TABLE acq.claim_policy_action (
+ id SERIAL PRIMARY KEY,
+ claim_policy INT NOT NULL REFERENCES acq.claim_policy
+ ON DELETE CASCADE
+ DEFERRABLE INITIALLY DEFERRED,
+ action_interval INTERVAL NOT NULL,
+ action INT NOT NULL REFERENCES acq.claim_event_type
+ DEFERRABLE INITIALLY DEFERRED,
+ CONSTRAINT action_sequence UNIQUE (claim_policy, action_interval)
+);
+
+COMMIT;
More information about the open-ils-commits
mailing list