2 DROP SCHEMA config CASCADE;
6 COMMENT ON SCHEMA config IS $$
8 * Copyright (C) 2005 Georgia Public Library Service
9 * Mike Rylander <mrylander@gmail.com>
11 * The config schema holds static configuration data for the
12 * Open-ILS installation.
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
29 CREATE TABLE config.bib_source (
30 id SERIAL PRIMARY KEY,
31 quality INT CHECK ( quality BETWEEN 0 AND 100 ),
32 source TEXT NOT NULL UNIQUE
34 COMMENT ON TABLE config.bib_source IS $$
36 * Copyright (C) 2005 Georgia Public Library Service
37 * Mike Rylander <mrylander@gmail.com>
39 * Valid sources of MARC records
41 * This is table is used to set up the relative "quality" of each
42 * MARC source, such as OCLC.
46 * This program is free software; you can redistribute it and/or
47 * modify it under the terms of the GNU General Public License
48 * as published by the Free Software Foundation; either version 2
49 * of the License, or (at your option) any later version.
51 * This program is distributed in the hope that it will be useful,
52 * but WITHOUT ANY WARRANTY; without even the implied warranty of
53 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54 * GNU General Public License for more details.
59 INSERT INTO config.bib_source (quality, source) VALUES (90, 'OcLC');
60 INSERT INTO config.bib_source (quality, source) VALUES (10, 'System Local');
62 CREATE TABLE config.standing (
63 id SERIAL PRIMARY KEY,
64 value TEXT NOT NULL UNIQUE
66 COMMENT ON TABLE config.standing IS $$
68 * Copyright (C) 2005 Georgia Public Library Service
69 * Mike Rylander <mrylander@gmail.com>
73 * This table contains the values that can be applied to a patron
74 * by a staff member. These values should not be changed, other
75 * that for translation, as the ID column is currently a "magic
76 * number" in the source. :(
80 * This program is free software; you can redistribute it and/or
81 * modify it under the terms of the GNU General Public License
82 * as published by the Free Software Foundation; either version 2
83 * of the License, or (at your option) any later version.
85 * This program is distributed in the hope that it will be useful,
86 * but WITHOUT ANY WARRANTY; without even the implied warranty of
87 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
88 * GNU General Public License for more details.
92 INSERT INTO config.standing (value) VALUES ('Good');
93 INSERT INTO config.standing (value) VALUES ('Barred');
97 CREATE TABLE config.metabib_field (
98 id SERIAL PRIMARY KEY,
99 field_class TEXT NOT NULL CHECK (lower(field_class) IN ('title','author','subject','keyword','series')),
100 name TEXT NOT NULL UNIQUE,
103 COMMENT ON TABLE config.metabib_field IS $$
105 * Copyright (C) 2005 Georgia Public Library Service
106 * Mike Rylander <mrylander@gmail.com>
108 * XPath used for WoRMing
110 * This table contains the XPath used to chop up MODS into it's
111 * indexable parts. Each XPath entry is named and assigned to
112 * a "class" of either title, subject, author, keyword or series.
117 * This program is free software; you can redistribute it and/or
118 * modify it under the terms of the GNU General Public License
119 * as published by the Free Software Foundation; either version 2
120 * of the License, or (at your option) any later version.
122 * This program is distributed in the hope that it will be useful,
123 * but WITHOUT ANY WARRANTY; without even the implied warranty of
124 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
125 * GNU General Public License for more details.
130 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'series', 'seriestitle', $$//mods:mods/mods:relatedItem[@type="series"]/mods:titleInfo$$ );
131 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'abbreviated', $$//mods:mods/mods:titleInfo[mods:title and (@type='abreviated')]$$ );
132 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'translated', $$//mods:mods/mods:titleInfo[mods:title and (@type='translated')]$$ );
133 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'uniform', $$//mods:mods/mods:titleInfo[mods:title and (@type='uniform')]$$ );
134 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'proper', $$//mods:mods/mods:titleInfo[mods:title and not (@type)]$$ );
135 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'author', 'corporate', $$//mods:mods/mods:name[@type='corporate']/mods:namePart[../mods:role/mods:text[text()='creator']]$$ );
136 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'author', 'personal', $$//mods:mods/mods:name[@type='personal']/mods:namePart[../mods:role/mods:text[text()='creator']]$$ );
137 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'author', 'conference', $$//mods:mods/mods:name[@type='conference']/mods:namePart[../mods:role/mods:text[text()='creator']]$$ );
138 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'author', 'other', $$//mods:mods/mods:name[@type='personal']/mods:namePart[not(../mods:role)]$$ );
139 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'geographic', $$//mods:mods/mods:subject/mods:geographic$$ );
140 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'name', $$//mods:mods/mods:subject/mods:name$$ );
141 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'temporal', $$//mods:mods/mods:subject/mods:temporal$$ );
142 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'topic', $$//mods:mods/mods:subject/mods:topic$$ );
143 -- INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'genre', $$//mods:mods/mods:genre$$ );
144 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'keyword', 'keyword', $$//mods:mods/*[not(local-name()='originInfo')]$$ ); -- /* to fool vim */
146 CREATE TABLE config.identification_type (
147 id SERIAL PRIMARY KEY,
148 name TEXT NOT NULL UNIQUE
150 COMMENT ON TABLE config.identification_type IS $$
152 * Copyright (C) 2005 Georgia Public Library Service
153 * Mike Rylander <mrylander@gmail.com>
155 * Types of valid patron identification.
157 * Each patron must display at least one valid form of identification
158 * in order to get a library card. This table lists those forms.
163 * This program is free software; you can redistribute it and/or
164 * modify it under the terms of the GNU General Public License
165 * as published by the Free Software Foundation; either version 2
166 * of the License, or (at your option) any later version.
168 * This program is distributed in the hope that it will be useful,
169 * but WITHOUT ANY WARRANTY; without even the implied warranty of
170 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
171 * GNU General Public License for more details.
176 INSERT INTO config.identification_type ( name ) VALUES ( 'Drivers Licence' );
177 INSERT INTO config.identification_type ( name ) VALUES ( 'Voter Card' );
178 INSERT INTO config.identification_type ( name ) VALUES ( 'Two Utility Bills' );
179 INSERT INTO config.identification_type ( name ) VALUES ( 'State ID' );
180 INSERT INTO config.identification_type ( name ) VALUES ( 'SSN' );
182 CREATE TABLE config.rule_circ_duration (
183 id SERIAL PRIMARY KEY,
184 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
185 extended INTERVAL NOT NULL,
186 normal INTERVAL NOT NULL,
187 shrt INTERVAL NOT NULL,
188 max_renewals INT NOT NULL
190 COMMENT ON TABLE config.rule_circ_duration IS $$
192 * Copyright (C) 2005 Georgia Public Library Service
193 * Mike Rylander <mrylander@gmail.com>
195 * Circulation Duration rules
197 * Each circulation is given a duration based on one of these rules.
202 * This program is free software; you can redistribute it and/or
203 * modify it under the terms of the GNU General Public License
204 * as published by the Free Software Foundation; either version 2
205 * of the License, or (at your option) any later version.
207 * This program is distributed in the hope that it will be useful,
208 * but WITHOUT ANY WARRANTY; without even the implied warranty of
209 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
210 * GNU General Public License for more details.
214 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '2wk_default', '21 days', '14 days', '7 days', 2);
217 CREATE TABLE config.rule_max_fine (
218 id SERIAL PRIMARY KEY,
219 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
220 amount NUMERIC(6,2) NOT NULL
222 COMMENT ON TABLE config.rule_max_fine IS $$
224 * Copyright (C) 2005 Georgia Public Library Service
225 * Mike Rylander <mrylander@gmail.com>
227 * Circulation Max Fine rules
229 * Each circulation is given a maximum fine based on one of
235 * This program is free software; you can redistribute it and/or
236 * modify it under the terms of the GNU General Public License
237 * as published by the Free Software Foundation; either version 2
238 * of the License, or (at your option) any later version.
240 * This program is distributed in the hope that it will be useful,
241 * but WITHOUT ANY WARRANTY; without even the implied warranty of
242 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
243 * GNU General Public License for more details.
247 INSERT INTO rule_max_fine VALUES (DEFAULT, 'books', 50.00);
250 CREATE TABLE config.rule_recuring_fine (
251 id SERIAL PRIMARY KEY,
252 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
253 high NUMERIC(6,2) NOT NULL,
254 normal NUMERIC(6,2) NOT NULL,
255 low NUMERIC(6,2) NOT NULL,
256 recurance_interval INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL
258 COMMENT ON TABLE config.rule_recuring_fine IS $$
260 * Copyright (C) 2005 Georgia Public Library Service
261 * Mike Rylander <mrylander@gmail.com>
263 * Circulation Recuring Fine rules
265 * Each circulation is given a recuring fine amount based on one of
266 * these rules. The recurance_interval should not be any shorter
267 * than the interval between runs of the fine_processor.pl script
268 * (which is run from CRON), or you could miss fines.
273 * This program is free software; you can redistribute it and/or
274 * modify it under the terms of the GNU General Public License
275 * as published by the Free Software Foundation; either version 2
276 * of the License, or (at your option) any later version.
278 * This program is distributed in the hope that it will be useful,
279 * but WITHOUT ANY WARRANTY; without even the implied warranty of
280 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
281 * GNU General Public License for more details.
285 INSERT INTO rule_recuring_fine VALUES (1, 'books', 0.50, 0.10, 0.10, '1 day');
288 CREATE TABLE config.rule_age_hold_protect (
289 id SERIAL PRIMARY KEY,
290 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
291 age INTERVAL NOT NULL,
294 COMMENT ON TABLE config.rule_age_hold_protect IS $$
296 * Copyright (C) 2005 Georgia Public Library Service
297 * Mike Rylander <mrylander@gmail.com>
299 * Hold Item Age Protection rules
301 * A hold request can only capture new(ish) items when they are
302 * within a particular proximity of the home_ou of the requesting
303 * user. The proximity ('prox' column) is calculated by counting
304 * the number of tree edges beween the user's home_ou and the owning_lib
305 * of the copy that could fulfill the hold.
310 * This program is free software; you can redistribute it and/or
311 * modify it under the terms of the GNU General Public License
312 * as published by the Free Software Foundation; either version 2
313 * of the License, or (at your option) any later version.
315 * This program is distributed in the hope that it will be useful,
316 * but WITHOUT ANY WARRANTY; without even the implied warranty of
317 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
318 * GNU General Public License for more details.
322 INSERT INTO rule_age_hold_protect VALUES (DEFAULT, '3month', '3 mons', 3);
323 INSERT INTO rule_age_hold_protect VALUES (DEFAULT, '6month', '6 mons', 2);
326 CREATE TABLE config.copy_status (
327 id SERIAL PRIMARY KEY,
328 name TEXT NOT NULL UNIQUE,
329 holdable BOOL NOT NULL DEFAULT FALSE
331 COMMENT ON TABLE config.copy_status IS $$
333 * Copyright (C) 2005 Georgia Public Library Service
334 * Mike Rylander <mrylander@gmail.com>
338 * The available copy statuses, and whether a copy in that
339 * status is available for hold request capture. 0 (zero) is
340 * the only special number in this set, meaning that the item
341 * is available for imediate checkout, and is counted as available
344 * Statuses with an ID below 100 are not removable, and have special
345 * meaning in the code. Do not change them except to translate the
348 * You may add and remove statuses above 100, and these can be used
349 * to remove items from normal circulation without affecting the rest
350 * of the copy's values or it's location.
354 * This program is free software; you can redistribute it and/or
355 * modify it under the terms of the GNU General Public License
356 * as published by the Free Software Foundation; either version 2
357 * of the License, or (at your option) any later version.
359 * This program is distributed in the hope that it will be useful,
360 * but WITHOUT ANY WARRANTY; without even the implied warranty of
361 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
362 * GNU General Public License for more details.
366 INSERT INTO config.copy_status (id,name,holdable) VALUES (0,'Available','t');
367 INSERT INTO config.copy_status (name,holdable) VALUES ('Checked out','t');
368 INSERT INTO config.copy_status (name) VALUES ('Bindery');
369 INSERT INTO config.copy_status (name) VALUES ('Lost');
370 INSERT INTO config.copy_status (name) VALUES ('Missing');
371 INSERT INTO config.copy_status (name,holdable) VALUES ('In process','t');
372 INSERT INTO config.copy_status (name,holdable) VALUES ('In transit','t');
373 INSERT INTO config.copy_status (name,holdable) VALUES ('Reshelving','t');
374 INSERT INTO config.copy_status (name) VALUES ('On holds shelf');
375 INSERT INTO config.copy_status (name,holdable) VALUES ('On order','t');
376 INSERT INTO config.copy_status (name) VALUES ('ILL');
377 INSERT INTO config.copy_status (name) VALUES ('Cataloging');
378 INSERT INTO config.copy_status (name) VALUES ('Reserves');
379 INSERT INTO config.copy_status (name) VALUES ('Discard/Weed');
381 SELECT SETVAL('config.copy_status_id_seq'::TEXT, 100);
384 CREATE TABLE config.net_access_level (
385 id SERIAL PRIMARY KEY,
386 name TEXT NOT NULL UNIQUE
388 COMMENT ON TABLE config.net_access_level IS $$
390 * Copyright (C) 2005 Georgia Public Library Service
391 * Mike Rylander <mrylander@gmail.com>
393 * Patron Network Access level
395 * This will be used to inform the in-library firewall of how much
396 * internet access the using patron should be allowed.
400 * This program is free software; you can redistribute it and/or
401 * modify it under the terms of the GNU General Public License
402 * as published by the Free Software Foundation; either version 2
403 * of the License, or (at your option) any later version.
405 * This program is distributed in the hope that it will be useful,
406 * but WITHOUT ANY WARRANTY; without even the implied warranty of
407 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
408 * GNU General Public License for more details.
412 INSERT INTO config.net_access_level (name) VALUES ('Restricted');
413 INSERT INTO config.net_access_level (name) VALUES ('Full');
414 INSERT INTO config.net_access_level (name) VALUES ('None');