[open-ils-commits] r16489 - in trunk/Open-ILS/src/sql/Pg: . upgrade (scottmk)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon May 24 14:52:06 EDT 2010
Author: scottmk
Date: 2010-05-24 14:52:02 -0400 (Mon, 24 May 2010)
New Revision: 16489
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0274.data.org-setting-type-est-wait.sql
Modified:
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
Log:
Split old org unit setting type circ.hold_estimate_wait_interval into two:
circ.holds.default_estimated_wait_interval
circ.holds.min_estimated_wait_interval
...with corresponding tweaks to label and description.
Also: change datatype from 'integer' to 'interval'.
For any existing rows in actor.org_unit_setting, pointing to the old
setting type: update them to point to circ.holds.default_estimated_wait_interval.
(Due to a foreign key constraint, the latter update has to happen in the same
transaction as the rename of the old row.)
M Open-ILS/src/sql/Pg/002.schema.config.sql
A Open-ILS/src/sql/Pg/upgrade/0274.data.org-setting-type-est-wait.sql
M Open-ILS/src/sql/Pg/950.data.seed-values.sql
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-05-24 18:31:41 UTC (rev 16488)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-05-24 18:52:02 UTC (rev 16489)
@@ -65,7 +65,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0273'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0274'); -- Scott McKellar
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-05-24 18:31:41 UTC (rev 16488)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-05-24 18:52:02 UTC (rev 16489)
@@ -1716,11 +1716,16 @@
'Amount of time to wait before changing an item from "reshelving" status to "available". Examples "1 day", "6 hours"',
'interval' ),
-( 'circ.hold_estimate_wait_interval',
- 'Holds: Estimated Wait (Days)',
- 'When predicting the amount of time a patron will be waiting for a hold to be fulfilled, this is the default/average number of days to assume an item will be checked out.',
- 'integer' ),
+( 'circ.holds.default_estimated_wait_interval',
+ 'Holds: Default Estimated Wait',
+ 'When predicting the amount of time a patron will be waiting for a hold to be fulfilled, this is the default estimated length of time to assume an item will be checked out.',
+ 'interval' ),
+( 'circ.holds.min_estimated_wait_interval',
+ 'Holds: Minimum Estimated Wait',
+ 'When predicting the amount of time a patron will be waiting for a hold to be fulfilled, this is the minimum estimated length of time to assume an item will be checked out.',
+ 'interval' ),
+
( 'circ.selfcheck.patron_login_timeout',
'Selfcheck: Patron Login Timeout (in seconds)',
'Number of seconds of inactivity before the patron is logged out of the selfcheck interfacer',
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0274.data.org-setting-type-est-wait.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0274.data.org-setting-type-est-wait.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0274.data.org-setting-type-est-wait.sql 2010-05-24 18:52:02 UTC (rev 16489)
@@ -0,0 +1,29 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0274'); -- Scott McKellar
+
+UPDATE config.org_unit_setting_type SET
+ name = 'circ.holds.default_estimated_wait_interval',
+ label = 'Holds: Default Estimated Wait',
+ description = 'When predicting the amount of time a patron will be waiting for a hold to be fulfilled, this is the default estimated length of time to assume an item will be checked out.',
+ datatype = 'interval'
+WHERE name = 'circ.hold_estimate_wait_interval';
+
+UPDATE actor.org_unit_setting SET
+ name = 'circ.holds.default_estimated_wait_interval',
+ value = value || ' days'
+WHERE name = 'circ.hold_estimate_wait_interval';
+
+INSERT INTO config.org_unit_setting_type (
+ name,
+ label,
+ description,
+ datatype
+) VALUES (
+ 'circ.holds.min_estimated_wait_interval',
+ 'Holds: Minimum Estimated Wait',
+ 'When predicting the amount of time a patron will be waiting for a hold to be fulfilled, this is the minimum estimated length of time to assume an item will be checked out.',
+ 'interval'
+);
+
+COMMIT;
More information about the open-ils-commits
mailing list