Two changes to config schema:
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 Oct 2010 15:55:14 +0000 (15:55 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 Oct 2010 15:55:14 +0000 (15:55 +0000)
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

git-svn-id: svn://svn.open-ils.org/ILS/trunk@18207 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0432.schema.config_hard_due_date.sql [new file with mode: 0644]

index 18fb37e..25206b3 100644 (file)
@@ -1869,6 +1869,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <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>
@@ -1881,6 +1882,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
             </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"/>
index 79f0bfb..995bd0f 100644 (file)
@@ -70,7 +70,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0431'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0432'); -- Scott McKellar
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
@@ -316,7 +316,8 @@ CREATE TABLE config.rule_circ_duration (
        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 $$
 /*
@@ -342,6 +343,14 @@ COMMENT ON TABLE config.rule_circ_duration IS $$
  */
 $$;
 
+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+$' ),
diff --git a/Open-ILS/src/sql/Pg/upgrade/0432.schema.config_hard_due_date.sql b/Open-ILS/src/sql/Pg/upgrade/0432.schema.config_hard_due_date.sql
new file mode 100644 (file)
index 0000000..bf13e9f
--- /dev/null
@@ -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;