Add a cancel_reason column to acq.lineitem_detail, pointing to
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 4 Mar 2010 22:11:29 +0000 (22:11 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 4 Mar 2010 22:11:29 +0000 (22:11 +0000)
acq.cancel_reason.  See KCLS ticket #3015.

M    Open-ILS/src/sql/Pg/200.schema.acq.sql
M    Open-ILS/src/sql/Pg/002.schema.config.sql
A    Open-ILS/src/sql/Pg/upgrade/0178.schema.acq.lid-cancel-reason.sql
M    Open-ILS/examples/fm_IDL.xml

git-svn-id: svn://svn.open-ils.org/ILS/trunk@15705 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/200.schema.acq.sql
Open-ILS/src/sql/Pg/upgrade/0178.schema.acq.lid-cancel-reason.sql [new file with mode: 0644]

index ceeeb91..ab89bb3 100644 (file)
@@ -5335,6 +5335,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
                        <field reporter:label="Note" name="note" reporter:datatype="text" />
                        <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
+                       <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
                </fields>
                <links>
                        <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
@@ -5344,6 +5345,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
                        <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
                        <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
+                       <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
                </links>
        </class>
 
index b752b15..6bcef9a 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 ('0177'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0178'); -- Scott McKellar
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index 44a3529..bc99f0e 100644 (file)
@@ -500,7 +500,8 @@ CREATE TABLE acq.lineitem_detail (
     circ_modifier   TEXT    REFERENCES config.circ_modifier (code) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED,
     owning_lib  INT         REFERENCES actor.org_unit (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED,
     location    INT         REFERENCES asset.copy_location (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED,
-    recv_time   TIMESTAMP WITH TIME ZONE
+    recv_time   TIMESTAMP WITH TIME ZONE,
+       cancel_reason   INT     REFERENCES acq.cancel_reason( id ) DEFERRABLE INITIALLY DEFERRED
 );
 
 CREATE INDEX li_detail_li_idx ON acq.lineitem_detail (lineitem);
diff --git a/Open-ILS/src/sql/Pg/upgrade/0178.schema.acq.lid-cancel-reason.sql b/Open-ILS/src/sql/Pg/upgrade/0178.schema.acq.lid-cancel-reason.sql
new file mode 100644 (file)
index 0000000..fa86630
--- /dev/null
@@ -0,0 +1,9 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0178'); -- Scott McKellar
+
+ALTER TABLE acq.lineitem_detail
+       ADD COLUMN cancel_reason        INT REFERENCES acq.cancel_reason( id )
+                                           DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;