Add column shelf_expire_time to action.hold_request.
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 3 Nov 2009 21:38:22 +0000 (21:38 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 3 Nov 2009 21:38:22 +0000 (21:38 +0000)
If auditor.action_hold_request_history exists, add columns
mint_condition and shelf_expire_time.

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/0070.schema.ahr-shelf-expire-time.sql
M    Open-ILS/examples/fm_IDL.xml

git-svn-id: svn://svn.open-ils.org/ILS/trunk@14751 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/0070.schema.ahr-shelf-expire-time.sql [new file with mode: 0644]

index af227d1..611838b 100644 (file)
@@ -2753,6 +2753,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
                        <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
                        <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
+                       <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
                        <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
                </fields>
                <links>
index 603c92c..67ef55f 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 ('0069'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0070'); -- Scott McKellar
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index df343e7..e716803 100644 (file)
@@ -355,7 +355,8 @@ CREATE TABLE action.hold_request (
        thaw_date               TIMESTAMP WITH TIME ZONE,
        shelf_time              TIMESTAMP WITH TIME ZONE,
     cut_in_line     BOOL,
-       mint_condition  BOOL NOT NULL DEFAULT TRUE
+       mint_condition  BOOL NOT NULL DEFAULT TRUE,
+       shelf_expire_time TIMESTAMPTZ
 );
 
 CREATE INDEX hold_request_target_idx ON action.hold_request (target);
diff --git a/Open-ILS/src/sql/Pg/upgrade/0070.schema.ahr-shelf-expire-time.sql b/Open-ILS/src/sql/Pg/upgrade/0070.schema.ahr-shelf-expire-time.sql
new file mode 100644 (file)
index 0000000..fe5c791
--- /dev/null
@@ -0,0 +1,17 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0070');
+
+ALTER TABLE action.hold_request
+ADD COLUMN shelf_expire_time TIMESTAMPTZ;
+
+COMMIT;
+
+-- If the following ALTERs die because the table doesn't exist, don't
+-- worry about it.  Some installations have it and some don't.
+
+ALTER TABLE auditor.action_hold_request_history
+ADD COLUMN mint_condition boolean NOT NULL DEFAULT TRUE;
+
+ALTER TABLE auditor.action_hold_request_history
+ADD COLUMN shelf_expire_time TIMESTAMPTZ;