3 INSERT INTO config.upgrade_log (version) VALUES ('0159'); -- miker
5 CREATE TABLE acq.user_request_type (
7 label TEXT NOT NULL UNIQUE -- i18n-ize
10 INSERT INTO acq.user_request_type (id,label) VALUES (1, oils_i18n_gettext('1', 'Books', 'aurt', 'label'));
11 INSERT INTO acq.user_request_type (id,label) VALUES (2, oils_i18n_gettext('2', 'Journal/Magazine & Newspaper Articles', 'aurt', 'label'));
12 INSERT INTO acq.user_request_type (id,label) VALUES (3, oils_i18n_gettext('3', 'Audiobooks', 'aurt', 'label'));
13 INSERT INTO acq.user_request_type (id,label) VALUES (4, oils_i18n_gettext('4', 'Music', 'aurt', 'label'));
14 INSERT INTO acq.user_request_type (id,label) VALUES (5, oils_i18n_gettext('5', 'DVDs', 'aurt', 'label'));
16 SELECT SETVAL('acq.user_request_type_id_seq'::TEXT, 6);
18 CREATE TABLE acq.user_request (
19 id SERIAL PRIMARY KEY,
20 usr INT NOT NULL REFERENCES actor.usr (id), -- requesting user
21 hold BOOL NOT NULL DEFAULT TRUE,
23 pickup_lib INT NOT NULL REFERENCES actor.org_unit (id), -- pickup lib
24 holdable_formats TEXT, -- nullable, for use in hold creation
26 email_notify BOOL NOT NULL DEFAULT TRUE,
27 lineitem INT REFERENCES acq.lineitem (id) ON DELETE CASCADE,
28 eg_bib BIGINT REFERENCES biblio.record_entry (id) ON DELETE CASCADE,
29 request_date TIMESTAMPTZ NOT NULL DEFAULT NOW(), -- when they requested it
30 need_before TIMESTAMPTZ, -- don't create holds after this
33 request_type INT NOT NULL REFERENCES acq.user_request_type (id),