Split old org unit setting type circ.hold_estimate_wait_interval into two:
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 24 May 2010 18:52:02 +0000 (18:52 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 24 May 2010 18:52:02 +0000 (18:52 +0000)
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

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16489 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/0274.data.org-setting-type-est-wait.sql [new file with mode: 0644]

index 043df44..10dfe7b 100644 (file)
@@ -65,7 +65,7 @@ CREATE TABLE config.upgrade_log (
     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,
index 0758192..12a3f57 100644 (file)
@@ -1716,10 +1716,15 @@ INSERT into config.org_unit_setting_type
   '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)',
diff --git a/Open-ILS/src/sql/Pg/upgrade/0274.data.org-setting-type-est-wait.sql b/Open-ILS/src/sql/Pg/upgrade/0274.data.org-setting-type-est-wait.sql
new file mode 100644 (file)
index 0000000..f1c02ad
--- /dev/null
@@ -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;