Line 0
Link Here
|
|
|
1 |
-- ILL Requests |
2 |
|
3 |
CREATE TABLE illrequests ( |
4 |
illrequest_id serial PRIMARY KEY, -- ILL request number |
5 |
borrowernumber integer DEFAULT NULL, -- Patron associated with request |
6 |
biblio_id integer DEFAULT NULL, -- Potential bib linked to request |
7 |
branchcode varchar(50) NOT NULL, -- The branch associated with the request |
8 |
status varchar(50) DEFAULT NULL, -- Current Koha status of request |
9 |
placed date DEFAULT NULL, -- Date the request was placed |
10 |
replied date DEFAULT NULL, -- Last API response |
11 |
updated timestamp DEFAULT CURRENT_TIMESTAMP -- Last modification to request |
12 |
ON UPDATE CURRENT_TIMESTAMP, |
13 |
completed date DEFAULT NULL, -- Date the request was completed |
14 |
medium varchar(30) DEFAULT NULL, -- The Koha request type |
15 |
accessurl varchar(500) DEFAULT NULL, -- Potential URL for accessing item |
16 |
cost varchar(20) DEFAULT NULL, -- Cost of request |
17 |
notesopac text DEFAULT NULL, -- Patron notes attached to request |
18 |
notesstaff text DEFAULT NULL, -- Staff notes attached to request |
19 |
orderid varchar(50) DEFAULT NULL, -- Backend id attached to request |
20 |
backend varchar(20) DEFAULT NULL, -- The backend used to create request |
21 |
CONSTRAINT `illrequests_bnfk` |
22 |
FOREIGN KEY (`borrowernumber`) |
23 |
REFERENCES `borrowers` (`borrowernumber`) |
24 |
ON UPDATE CASCADE ON DELETE CASCADE, |
25 |
CONSTRAINT `illrequests_bcfk_2` |
26 |
FOREIGN KEY (`branchcode`) |
27 |
REFERENCES `branches` (`branchcode`) |
28 |
ON UPDATE CASCADE ON DELETE CASCADE |
29 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
30 |
|
31 |
-- ILL Request Attributes |
32 |
|
33 |
CREATE TABLE illrequestattributes ( |
34 |
illrequest_id bigint(20) unsigned NOT NULL, -- ILL request number |
35 |
type varchar(200) NOT NULL, -- API ILL property name |
36 |
value text NOT NULL, -- API ILL property value |
37 |
PRIMARY KEY (`illrequest_id`,`type`), |
38 |
CONSTRAINT `illrequestattributes_ifk` |
39 |
FOREIGN KEY (illrequest_id) |
40 |
REFERENCES `illrequests` (`illrequest_id`) |
41 |
ON UPDATE CASCADE ON DELETE CASCADE |
42 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |
43 |
|
44 |
-- System preferences |
45 |
|
46 |
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES |
47 |
('ILLModule','0','If ON, enables the interlibrary loans module.','','YesNo'); |
48 |
|
49 |
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES |
50 |
('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'); |
51 |
|
52 |
-- Userflags |
53 |
|
54 |
INSERT INTO userflags (bit,flag,flagdesc,defaulton) |
55 |
VALUES (22,'ill','The Interlibrary Loans Module',0); |