]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/1127.data.schema.acq.patron_requests.sql
LP#1774277 Stamping upgrade for patron acq reqs
[Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 1127.data.schema.acq.patron_requests.sql
1 BEGIN;
2
3 SELECT evergreen.upgrade_deps_block_check('1127', :eg_version);
4
5 ALTER TABLE acq.user_request ADD COLUMN cancel_time TIMESTAMPTZ;
6 ALTER TABLE acq.user_request ADD COLUMN upc TEXT;
7 ALTER TABLE action.hold_request ADD COLUMN acq_request INT REFERENCES acq.user_request (id);
8
9 UPDATE
10     config.org_unit_setting_type
11 SET
12     label = oils_i18n_gettext(
13         'circ.holds.canceled.display_age',
14         'Canceled holds/requests display age',
15         'coust', 'label'),
16     description = oils_i18n_gettext(
17         'circ.holds.canceled.display_age',
18         'Show all canceled entries in patron holds and patron acquisition requests interfaces that were canceled within this amount of time',
19         'coust', 'description')
20 WHERE
21     name = 'circ.holds.canceled.display_age'
22 ;
23
24 UPDATE
25     config.org_unit_setting_type
26 SET
27     label = oils_i18n_gettext(
28         'circ.holds.canceled.display_count',
29         'Canceled holds/requests display count',
30         'coust', 'label'),
31     description = oils_i18n_gettext(
32         'circ.holds.canceled.display_count',
33         'How many canceled entries to show in patron holds and patron acquisition requests interfaces',
34         'coust', 'description')
35 WHERE
36     name = 'circ.holds.canceled.display_count'
37 ;
38
39 INSERT INTO acq.cancel_reason (org_unit, keep_debits, id, label, description)
40     VALUES (
41         1, 'f', 1015,
42         oils_i18n_gettext(1015, 'Canceled: Fulfilled', 'acqcr', 'label'),
43         oils_i18n_gettext(1015, 'This acquisition request has been fulfilled.', 'acqcr', 'description')
44     )
45 ;
46
47 UPDATE
48     acq.user_request_type
49 SET
50     label = oils_i18n_gettext('2', 'Articles', 'aurt', 'label')
51 WHERE
52     id = 2
53 ;
54
55 INSERT INTO acq.user_request_type (id,label)
56     SELECT 6, oils_i18n_gettext('6', 'Other', 'aurt', 'label');
57
58 SELECT SETVAL('acq.user_request_type_id_seq'::TEXT, (SELECT MAX(id)+1 FROM acq.user_request_type));
59
60 INSERT INTO permission.perm_list ( id, code, description ) VALUES
61  ( 610, 'CLEAR_PURCHASE_REQUEST', oils_i18n_gettext(610,
62     'Clear Completed User Purchase Requests', 'ppl', 'description'))
63 ;
64
65 CREATE TABLE acq.user_request_status_type (
66      id  SERIAL  PRIMARY KEY
67     ,label TEXT
68 );
69
70 INSERT INTO acq.user_request_status_type (id,label) VALUES
71      (0,oils_i18n_gettext(0,'Error','aurst','label'))
72     ,(1,oils_i18n_gettext(1,'New','aurst','label'))
73     ,(2,oils_i18n_gettext(2,'Pending','aurst','label'))
74     ,(3,oils_i18n_gettext(3,'Ordered, Hold Not Placed','aurst','label'))
75     ,(4,oils_i18n_gettext(4,'Ordered, Hold Placed','aurst','label'))
76     ,(5,oils_i18n_gettext(5,'Received','aurst','label'))
77     ,(6,oils_i18n_gettext(6,'Fulfilled','aurst','label'))
78     ,(7,oils_i18n_gettext(7,'Canceled','aurst','label'))
79 ;
80
81 SELECT SETVAL('acq.user_request_status_type_id_seq'::TEXT, 100);
82
83 -- not used
84 DELETE FROM actor.org_unit_setting WHERE name = 'acq.holds.allow_holds_from_purchase_request';
85 DELETE FROM config.org_unit_setting_type_log WHERE field_name = 'acq.holds.allow_holds_from_purchase_request';
86 DELETE FROM config.org_unit_setting_type WHERE name = 'acq.holds.allow_holds_from_purchase_request';
87
88 COMMIT;