File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Open-ILS/src/sql/Pg/version-upgrade Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ -- Upgrade Script for 3.16.0 to 3.16.1
2+ \set eg_version ' ' ' 3.16.1' ' '
3+ BEGIN ;
4+ INSERT INTO config .upgrade_log (version, applied_to) VALUES (' 3.16.1' , :eg_version);
5+
6+ SELECT evergreen .upgrade_deps_block_check (' 1503' , :eg_version);
7+
8+ CREATE OR REPLACE FUNCTION asset .record_has_holdable_copy ( rid BIGINT , ou INT DEFAULT NULL ) RETURNS BOOL AS $f$
9+ DECLARE
10+ ous INT [] := (SELECT array_agg(id) FROM actor .org_unit_descendants (COALESCE(ou, (SELECT id FROM evergreen .org_top ()))));
11+ BEGIN
12+ PERFORM 1
13+ FROM
14+ asset .copy acp
15+ JOIN asset .call_number acn ON acp .call_number = acn .id
16+ JOIN asset .copy_location acpl ON acp .location = acpl .id
17+ JOIN config .copy_status ccs ON acp .status = ccs .id
18+ WHERE
19+ acn .record = rid
20+ AND acp .holdable = true
21+ AND acpl .holdable = true
22+ AND ccs .holdable = true
23+ AND acp .deleted = false
24+ AND acpl .deleted = false
25+ AND acp .circ_lib = ANY(ous)
26+ LIMIT 1 ;
27+ IF FOUND THEN
28+ RETURN true;
29+ END IF;
30+ RETURN FALSE;
31+ END;
32+ $f$ LANGUAGE PLPGSQL;
33+
34+
35+ SELECT evergreen .upgrade_deps_block_check (' 1504' , :eg_version); -- phasefx
36+
37+ -- A/T seed data
38+ INSERT into action_trigger .hook (key, core_type, description) VALUES
39+ ( ' au.erenewal' , ' au' , ' A patron has been renewed via Erenewal' );
40+
41+ COMMIT ;
You can’t perform that action at this time.
0 commit comments