Replace claim_interval column with claim_policy column, a foreign key
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 25 Mar 2010 18:07:56 +0000 (18:07 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 25 Mar 2010 18:07:56 +0000 (18:07 +0000)
pointing to acq.claim_policy.

(...thus bringing the history table back into sync with its source table.)

M    Open-ILS/src/sql/Pg/002.schema.config.sql
A    Open-ILS/src/sql/Pg/upgrade/0214.schema.acq.replace-claim-interval.sql
M    Open-ILS/examples/fm_IDL.xml

git-svn-id: svn://svn.open-ils.org/ILS/trunk@15980 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/0214.schema.acq.replace-claim-interval.sql [new file with mode: 0644]

index 8b08806..aa0e702 100644 (file)
@@ -5307,7 +5307,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
                        <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
                        <field reporter:label="State" name="state" reporter:datatype="text"/>
-                       <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" />
                </fields>
@@ -5321,6 +5321,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
                        <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
                        <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
+                       <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">
index 064320a..f22a9b9 100644 (file)
@@ -59,7 +59,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0213'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0214'); -- Scott McKellar
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0214.schema.acq.replace-claim-interval.sql b/Open-ILS/src/sql/Pg/upgrade/0214.schema.acq.replace-claim-interval.sql
new file mode 100644 (file)
index 0000000..c703289
--- /dev/null
@@ -0,0 +1,13 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0214'); -- Scott McKellar
+
+ALTER TABLE acq.acq_lineitem_history
+       DROP COLUMN claim_interval;
+
+ALTER TABLE acq.acq_lineitem_history
+       ADD COLUMN claim_policy INT
+               REFERENCES acq.claim_policy
+               DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;