add serial.subscription.owning_lib
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Jun 2010 16:10:59 +0000 (16:10 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Jun 2010 16:10:59 +0000 (16:10 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16760 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/210.schema.serials.sql
Open-ILS/src/sql/Pg/upgrade/0313.schema.subscription-owner.sql [new file with mode: 0644]

index 6989048..f0df743 100644 (file)
@@ -3043,12 +3043,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
        <class id="ssub" controller="open-ils.cstore" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
                <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
                        <field reporter:label="Id" name="id" reporter:datatype="id"/>
+                       <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
                        <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
                        <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
                        <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
                        <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
                </fields>
                <links>
+                       <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
                        <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
                </links>
        </class>
index f1121d4..ae406a2 100644 (file)
@@ -68,7 +68,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0312'); -- atz
+INSERT INTO config.upgrade_log (version) VALUES ('0313'); -- miker
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index c320491..5e31660 100644 (file)
@@ -28,6 +28,7 @@ CREATE RULE protect_mfhd_delete AS ON DELETE TO serial.record_entry DO INSTEAD U
 
 CREATE TABLE serial.subscription (
        id                     SERIAL       PRIMARY KEY,
+       owning_lib             INT     NOT NULL DEFAULT 1 REFERENCES actor.org_unit (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED,
        start_date             TIMESTAMP WITH TIME ZONE     NOT NULL,
        end_date               TIMESTAMP WITH TIME ZONE,    -- interpret NULL as current subscription
        record_entry           BIGINT       REFERENCES biblio.record_entry (id)
diff --git a/Open-ILS/src/sql/Pg/upgrade/0313.schema.subscription-owner.sql b/Open-ILS/src/sql/Pg/upgrade/0313.schema.subscription-owner.sql
new file mode 100644 (file)
index 0000000..cc9a2b2
--- /dev/null
@@ -0,0 +1,10 @@
+BEGIN;
+
+-- Org Unit Settings for configuring org unit weights and org unit max-loops for hold targeting
+
+INSERT INTO config.upgrade_log (version) VALUES ('0313'); --miker
+
+ALTER TABLE serial.subscription ADD COLUMN owning_lib INT NOT NULL DEFAULT 1 REFERENCES actor.org_unit (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;
+