Add column prev_dest to action.transit_copy and
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 3 Nov 2009 18:50:40 +0000 (18:50 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 3 Nov 2009 18:50:40 +0000 (18:50 +0000)
action.hold_transit_copy.

M    Open-ILS/src/sql/Pg/090.schema.action.sql
M    Open-ILS/src/sql/Pg/002.schema.config.sql
A    Open-ILS/src/sql/Pg/upgrade/0069.schema.atc-prev-dest.sql
M    Open-ILS/examples/fm_IDL.xml

git-svn-id: svn://svn.open-ils.org/ILS/trunk@14745 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/090.schema.action.sql
Open-ILS/src/sql/Pg/upgrade/0069.schema.atc-prev-dest.sql [new file with mode: 0644]

index 4efd940..af227d1 100644 (file)
@@ -1159,6 +1159,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
                        <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
                        <field reporter:label="Source" name="source" reporter:datatype="link"/>
+                       <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
                        <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
                        <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
                        <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
@@ -1166,6 +1167,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                <links>
                        <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
                        <link field="source" reltype="has_a" key="id" map="" class="aou"/>
+                       <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
                        <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
                        <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
                        <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
@@ -2816,6 +2818,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
                        <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
@@ -2836,6 +2839,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <link field="distribution_formula_entries" reltype="has_many" key="owning_lib" map="" class="acqdfe"/>
                        <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
                        <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
+                       <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
                </links>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
             <actions>
@@ -3774,6 +3778,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
                        <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
                        <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
+                       <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
                </fields>
                <links>
                        <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
@@ -3781,6 +3786,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <link field="source" reltype="has_a" key="id" map="" class="aou"/>
                        <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
                        <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
+                       <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
                        <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
                </links>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
index 26598f8..603c92c 100644 (file)
@@ -51,7 +51,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0068'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0069'); -- Scott McKellar
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index 6508d8b..df343e7 100644 (file)
@@ -414,7 +414,8 @@ CREATE TABLE action.transit_copy (
        dest                    INT                             NOT NULL REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED,
        prev_hop                INT                             REFERENCES action.transit_copy (id) DEFERRABLE INITIALLY DEFERRED,
        copy_status             INT                             NOT NULL REFERENCES config.copy_status (id) DEFERRABLE INITIALLY DEFERRED,
-       persistant_transfer     BOOL                            NOT NULL DEFAULT FALSE
+       persistant_transfer     BOOL                            NOT NULL DEFAULT FALSE,
+       prev_dest       INT                             NOT NULL REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED
 );
 CREATE INDEX active_transit_dest_idx ON "action".transit_copy (dest); 
 CREATE INDEX active_transit_source_idx ON "action".transit_copy (source);
diff --git a/Open-ILS/src/sql/Pg/upgrade/0069.schema.atc-prev-dest.sql b/Open-ILS/src/sql/Pg/upgrade/0069.schema.atc-prev-dest.sql
new file mode 100644 (file)
index 0000000..2e6a0d8
--- /dev/null
@@ -0,0 +1,9 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0069');
+
+ALTER TABLE action.transit_copy
+ADD COLUMN prev_dest INTEGER REFERENCES actor.org_unit( id )
+                                                        DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;