[open-ils-commits] r18208 - in branches/rel_1_6/Open-ILS: examples src/sql/Pg src/sql/Pg/upgrade (scottmk)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Oct 6 12:08:31 EDT 2010


Author: scottmk
Date: 2010-10-06 12:08:28 -0400 (Wed, 06 Oct 2010)
New Revision: 18208

Added:
   branches/rel_1_6/Open-ILS/src/sql/Pg/upgrade/0432.schema.config_hard_due_date.sql
Modified:
   branches/rel_1_6/Open-ILS/examples/fm_IDL.xml
   branches/rel_1_6/Open-ILS/src/sql/Pg/002.schema.config.sql
Log:
Two changes to config schema:

1. Add new column date_ceiling to rule_circ_duration table.

2. New table hard_due_date.

For trunk, v1.6, v1.6.2 (eventually), and v2.1 (eventually).

NOT for v1.6.1 or v2.0.

M    Open-ILS/src/sql/Pg/002.schema.config.sql
A    Open-ILS/src/sql/Pg/upgrade/0432.schema.config_hard_due_date.sql
M    Open-ILS/examples/fm_IDL.xml


Modified: branches/rel_1_6/Open-ILS/examples/fm_IDL.xml
===================================================================
--- branches/rel_1_6/Open-ILS/examples/fm_IDL.xml	2010-10-06 15:55:14 UTC (rev 18207)
+++ branches/rel_1_6/Open-ILS/examples/fm_IDL.xml	2010-10-06 16:08:28 UTC (rev 18208)
@@ -1562,6 +1562,7 @@
 			<field name="name" reporter:datatype="text"/>
 			<field name="normal" reporter:datatype="interval"/>
 			<field name="shrt" reporter:datatype="interval"/>
+			<field name="date_ceiling" reporter:datatype="timestamp"/>
 		</fields>
 		<links>
 		</links>
@@ -1574,6 +1575,21 @@
             </actions>
         </permacrud>
 	</class>
+
+    <class id="chdd" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hard_due_date" oils_persist:tablename="config.hard_due_date" reporter:label="Hard Due Date">
+        <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
+            <field reporter:label="ID" name="id" reporter:datatype="id"/>
+            <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
+            <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
+            <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
+        </fields>
+        <links>
+            <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
+        </links>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+        </permacrud>
+    </class>
+
 	<class id="mobts" controller="open-ils.cstore" oils_obj:fieldmapper="money::open_billable_transaction_summary" oils_persist:tablename="money.open_billable_xact_summary" reporter:label="Open Billable Transaction Summary">
 		<fields oils_persist:primary="id" oils_persist:sequence="">
 			<field name="balance_owed" reporter:datatype="money"/>

Modified: branches/rel_1_6/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- branches/rel_1_6/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-10-06 15:55:14 UTC (rev 18207)
+++ branches/rel_1_6/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-10-06 16:08:28 UTC (rev 18208)
@@ -250,7 +250,8 @@
 	extended	INTERVAL	NOT NULL,
 	normal		INTERVAL	NOT NULL,
 	shrt		INTERVAL	NOT NULL,
-	max_renewals	INT		NOT NULL
+	max_renewals	INT		NOT NULL,
+	date_ceiling    TIMESTAMPTZ
 );
 COMMENT ON TABLE config.rule_circ_duration IS $$
 /*
@@ -276,6 +277,14 @@
  */
 $$;
 
+CREATE TABLE config.hard_due_date (
+    id              SERIAL      PRIMARY KEY,
+    duration_rule   INT         NOT NULL REFERENCES config.rule_circ_duration (id)
+                                DEFERRABLE INITIALLY DEFERRED,
+    ceiling_date    TIMESTAMPTZ NOT NULL,
+    active_date     TIMESTAMPTZ NOT NULL
+);
+
 CREATE TABLE config.rule_max_fine (
     id          SERIAL          PRIMARY KEY,
     name        TEXT            NOT NULL UNIQUE CHECK ( name ~ E'^\\w+$' ),

Added: branches/rel_1_6/Open-ILS/src/sql/Pg/upgrade/0432.schema.config_hard_due_date.sql
===================================================================
--- branches/rel_1_6/Open-ILS/src/sql/Pg/upgrade/0432.schema.config_hard_due_date.sql	                        (rev 0)
+++ branches/rel_1_6/Open-ILS/src/sql/Pg/upgrade/0432.schema.config_hard_due_date.sql	2010-10-06 16:08:28 UTC (rev 18208)
@@ -0,0 +1,16 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0432'); -- Scott McKellar
+
+ALTER TABLE config.rule_circ_duration
+	ADD COLUMN date_ceiling TIMESTAMPTZ;
+
+CREATE TABLE config.hard_due_date (
+	id              SERIAL      PRIMARY KEY,
+	duration_rule   INT         NOT NULL REFERENCES config.rule_circ_duration (id)
+	                            DEFERRABLE INITIALLY DEFERRED,
+	ceiling_date    TIMESTAMPTZ NOT NULL,
+	active_date     TIMESTAMPTZ NOT NULL
+);
+
+COMMIT;



More information about the open-ils-commits mailing list