[open-ils-commits] r15188 - in trunk/Open-ILS: examples src/perlmods/OpenILS/Application/Storage/CDBI src/perlmods/OpenILS/Application/Storage/Driver/Pg src/sql/Pg src/sql/Pg/upgrade (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Dec 17 16:49:11 EST 2009
Author: miker
Date: 2009-12-17 16:49:05 -0500 (Thu, 17 Dec 2009)
New Revision: 15188
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/119.schema.booking.transits.sql
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/095.schema.booking.sql
Log:
add tracking table for booking reservations transits (similar to hold transits)
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2009-12-17 21:17:52 UTC (rev 15187)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2009-12-17 21:49:05 UTC (rev 15188)
@@ -4065,6 +4065,41 @@
</class>
+ <class id="artc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::reservation_transit_copy" oils_persist:tablename="action.reservation_transit_copy" reporter:core="true" reporter:label="Reservation Transit">
+ <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
+ <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
+ <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
+ <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
+ <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
+ <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
+ <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
+ <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
+ <field reporter:label="Sending Library" name="source" 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="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"/>
+ <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
+ <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="reservation" reltype="has_a" key="id" map="" class="bresv"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="TRANSIT_COPY">
+ <context link="target_copy" field="owner"/>
+ </create>
+ <retrieve/>
+ <update permission="UPDATE_TRANSIT" context_field="dest source"/>
+ <delete permission="DELETE_TRANSIT" context_field="dest source"/>
+ </actions>
+ </permacrud>
+ </class>
<class id="ahtc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_transit_copy" oils_persist:tablename="action.hold_transit_copy" reporter:core="true" reporter:label="Hold Transit">
<fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
<field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm 2009-12-17 21:17:52 UTC (rev 15187)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm 2009-12-17 21:49:05 UTC (rev 15188)
@@ -127,6 +127,16 @@
#-------------------------------------------------------------------------------
+package action::reservation_transit_copy;
+use base qw/action/;
+__PACKAGE__->table('action_reservation_transit_copy');
+__PACKAGE__->columns(Primary => 'id');
+__PACKAGE__->columns(Essential => qw/source dest persistant_transfer target_copy
+ source_send_time dest_recv_time prev_hop prev_dest
+ copy_status reservation/);
+
+#-------------------------------------------------------------------------------
+
package action::transit_copy;
use base qw/action/;
__PACKAGE__->table('action_transit_copy');
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm 2009-12-17 21:17:52 UTC (rev 15187)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm 2009-12-17 21:49:05 UTC (rev 15188)
@@ -689,6 +689,13 @@
#-------------------------------------------------------------------------------
+ package action::reservation_transit_copy;
+
+ action::reservation_transit_copy->sequence( 'action.transit_copy_id_seq' );
+ action::reservation_transit_copy->table('action.reservation_transit_copy');
+
+ #-------------------------------------------------------------------------------
+
package action::transit_copy;
action::transit_copy->sequence( 'action.transit_copy_id_seq' );
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-12-17 21:17:52 UTC (rev 15187)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-12-17 21:49:05 UTC (rev 15188)
@@ -51,7 +51,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0118'); -- berick
+INSERT INTO config.upgrade_log (version) VALUES ('0119'); -- miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/095.schema.booking.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/095.schema.booking.sql 2009-12-17 21:17:52 UTC (rev 15187)
+++ trunk/Open-ILS/src/sql/Pg/095.schema.booking.sql 2009-12-17 21:49:05 UTC (rev 15188)
@@ -156,4 +156,13 @@
CONSTRAINT bravm_logical_key UNIQUE(reservation, attr_value)
);
+CREATE TABLE action.reservation_transit_copy (
+ reservation INT REFERENCES booking.reservation (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED
+) INHERITS (action.transit_copy);
+ALTER TABLE action.reservation_transit_copy ADD PRIMARY KEY (id);
+ALTER TABLE action.reservation_transit_copy ADD CONSTRAINT artc_tc_fkey FOREIGN KEY (target_copy) REFERENCES booking.resource (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
+CREATE INDEX active_reservation_transit_dest_idx ON "action".reservation_transit_copy (dest);
+CREATE INDEX active_reservation_transit_source_idx ON "action".reservation_transit_copy (source);
+CREATE INDEX active_reservation_transit_cp_idx ON "action".reservation_transit_copy (target_copy);
+
COMMIT;
Added: trunk/Open-ILS/src/sql/Pg/upgrade/119.schema.booking.transits.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/119.schema.booking.transits.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/119.schema.booking.transits.sql 2009-12-17 21:49:05 UTC (rev 15188)
@@ -0,0 +1,15 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0119'); -- miker
+
+CREATE TABLE action.reservation_transit_copy (
+ reservation INT REFERENCES booking.reservation (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED
+) INHERITS (action.transit_copy);
+ALTER TABLE action.reservation_transit_copy ADD PRIMARY KEY (id);
+ALTER TABLE action.reservation_transit_copy ADD CONSTRAINT artc_tc_fkey FOREIGN KEY (target_copy) REFERENCES booking.resource (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
+CREATE INDEX active_reservation_transit_dest_idx ON "action".reservation_transit_copy (dest);
+CREATE INDEX active_reservation_transit_source_idx ON "action".reservation_transit_copy (source);
+CREATE INDEX active_reservation_transit_cp_idx ON "action".reservation_transit_copy (target_copy);
+
+COMMIT;
+
More information about the open-ils-commits
mailing list