]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/1203.hpprox-best-hold-sort-order.sql
LP1615805 No inputs after submit in patron search (AngularJS)
[working/Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 1203.hpprox-best-hold-sort-order.sql
1 BEGIN;
2
3 SELECT evergreen.upgrade_deps_block_check('1203', :eg_version);
4
5 ALTER TABLE config.best_hold_order ADD COLUMN owning_lib_to_home_lib_prox INT; -- copy owning lib <-> user home lib prox
6
7 ALTER table config.best_hold_order DROP CONSTRAINT best_hold_order_check;
8
9 -- At least one of these columns must contain a non-null value
10 ALTER TABLE config.best_hold_order ADD CHECK ((
11     pprox IS NOT NULL OR
12     hprox IS NOT NULL OR
13     owning_lib_to_home_lib_prox IS NOT NULL OR
14     aprox IS NOT NULL OR
15     priority IS NOT NULL OR
16     cut IS NOT NULL OR
17     depth IS NOT NULL OR
18     htime IS NOT NULL OR
19     rtime IS NOT NULL
20 ));
21
22 INSERT INTO config.best_hold_order (
23     name,
24     owning_lib_to_home_lib_prox, hprox, approx, pprox, aprox, priority, cut, depth, rtime
25 ) VALUES (
26     'Traditional with Holds-chase-home-lib-patrons',
27     1, 2, 3, 4, 5, 6, 7, 8, 9
28 );
29
30 COMMIT;