3 INSERT INTO config.upgrade_log (version) VALUES ('0082'); -- miker
5 CREATE TABLE config.usr_setting_type (
8 opac_visible BOOL NOT NULL DEFAULT FALSE,
9 label TEXT UNIQUE NOT NULL,
11 datatype TEXT NOT NULL DEFAULT 'string',
15 -- define valid datatypes
17 CONSTRAINT coust_valid_datatype CHECK ( datatype IN
18 ( 'bool', 'integer', 'float', 'currency', 'interval',
19 'date', 'string', 'object', 'array', 'link' ) ),
22 -- fm_class is meaningful only for 'link' datatype
24 CONSTRAINT coust_no_empty_link CHECK
25 ( ( datatype = 'link' AND fm_class IS NOT NULL ) OR
26 ( datatype <> 'link' AND fm_class IS NULL ) )
30 -- Yeah, this is data, but I need it for the schema bit at the end
31 INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
32 VALUES ('opac.default_font', TRUE, 'OPAC Font Size', 'OPAC Font Size', 'string');
34 INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
35 VALUES ('opac.default_search_depth', TRUE, 'OPAC Search Depth', 'OPAC Search Depth', 'integer');
37 INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
38 VALUES ('opac.default_search_location', TRUE, 'OPAC Search Location', 'OPAC Search Location', 'integer');
40 INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
41 VALUES ('opac.hits_per_page', TRUE, 'Hits per Page', 'Hits per Page', 'string');
43 INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
44 VALUES ('opac.hold_notify', TRUE, 'Hold Notification Format', 'Hold Notification Format', 'string');
46 INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
47 VALUES ('staff_client.catalog.record_view.default', TRUE, 'Default Record View', 'Default Record View', 'string');
49 INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
50 VALUES ('staff_client.copy_editor.templates', TRUE, 'Copy Editor Template', 'Copy Editor Template', 'object');
52 INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
53 VALUES ('circ.holds_behind_desk', FALSE, 'Hold is behind Circ Desk', 'Hold is behind Circ Desk', 'bool');
55 INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype)
56 SELECT DISTINCT name, FALSE, name, name, 'string'
57 FROM actor.usr_setting
59 'circ.holds_behind_desk',
61 'opac.default_search_depth',
62 'opac.default_search_location',
65 'staff_client.catalog.record_view.default',
66 'staff_client.copy_editor.templates'
70 ALTER TABLE actor.usr_setting
71 ADD CONSTRAINT user_setting_type_fkey
72 FOREIGN KEY (name) REFERENCES config.usr_setting_type (name)
73 ON DELETE CASCADE ON UPDATE CASCADE
74 DEFERRABLE INITIALLY DEFERRED;