[open-ils-commits] r15733 - 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
Mon Mar 8 10:53:10 EST 2010


Author: scottmk
Date: 2010-03-08 10:53:07 -0500 (Mon, 08 Mar 2010)
New Revision: 15733

Added:
   trunk/Open-ILS/src/sql/Pg/upgrade/0181.schema.acq-user-request-cancel-cause.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 a cancel_reason column to acq.user_request, pointing to acq.cancel_reason.

Also: corrected the IDL entries for similar columns elsewhere.  The <link>
should have a reltype of "might_have", not "has_a", since the column is nullable.

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/0181.schema.acq-user-request-cancel-cause.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-08 15:31:03 UTC (rev 15732)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2010-03-08 15:53:07 UTC (rev 15733)
@@ -4386,6 +4386,7 @@
 			<field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
 			<field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
 			<field reporter:label="Need Before Date" name="need_before" reporter:datatype="timestamp" />
+			<field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
 		</fields>
 		<links>
 			<link field="usr" reltype="has_a" key="id" map="" class="au"/>
@@ -4393,6 +4394,7 @@
 			<link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
 			<link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
 			<link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
+			<link field="cancel_reason" reltype="might_have" key="id" map="" class="acqcr"/>
 		</links>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
             <actions>
@@ -5136,7 +5138,7 @@
 			<link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
 			<link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
 			<link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
-			<link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
+			<link field="cancel_reason" reltype="might_have" key="id" map="" class="acqcr"/>
 		</links>
 		<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
 			<actions>
@@ -5229,7 +5231,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="has_a" key="id" map="" class="acqcr"/>
+			<link field="cancel_reason" reltype="might_have" 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">
@@ -5357,7 +5359,7 @@
 			<link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
 			<link field="location" reltype="has_a" key="id" map="" class="acpl"/>
 			<link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
-			<link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
+			<link field="cancel_reason" reltype="might_have" key="id" map="" class="acqcr"/>
 		</links>
 	</class>
 

Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-03-08 15:31:03 UTC (rev 15732)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-03-08 15:53:07 UTC (rev 15733)
@@ -51,7 +51,7 @@
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0180'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0181'); -- 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-08 15:31:03 UTC (rev 15732)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql	2010-03-08 15:53:07 UTC (rev 15733)
@@ -831,7 +831,9 @@
     location            TEXT,
     pubdate             TEXT,
     mentioned           TEXT,
-    other_info          TEXT
+    other_info          TEXT,
+	cancel_reason       INT    REFERENCES acq.cancel_reason( id )
+	                           DEFERRABLE INITIALLY DEFERRED
 );
 
 

Added: trunk/Open-ILS/src/sql/Pg/upgrade/0181.schema.acq-user-request-cancel-cause.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0181.schema.acq-user-request-cancel-cause.sql	                        (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0181.schema.acq-user-request-cancel-cause.sql	2010-03-08 15:53:07 UTC (rev 15733)
@@ -0,0 +1,9 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0181'); -- Scott McKellar
+
+ALTER TABLE acq.user_request
+	ADD COLUMN cancel_reason   INT
+		REFERENCES acq.cancel_reason( id ) DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;



More information about the open-ils-commits mailing list