2 DROP SCHEMA stats CASCADE;
3 DROP SCHEMA config CASCADE;
9 COMMENT ON SCHEMA config IS $$
11 * Copyright (C) 2005 Georgia Public Library Service
12 * Mike Rylander <mrylander@gmail.com>
14 * The config schema holds static configuration data for the
15 * Open-ILS installation.
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
32 CREATE TABLE config.bib_source (
33 id SERIAL PRIMARY KEY,
34 quality INT CHECK ( quality BETWEEN 0 AND 100 ),
35 source TEXT NOT NULL UNIQUE
37 COMMENT ON TABLE config.bib_source IS $$
39 * Copyright (C) 2005 Georgia Public Library Service
40 * Mike Rylander <mrylander@gmail.com>
42 * Valid sources of MARC records
44 * This is table is used to set up the relative "quality" of each
45 * MARC source, such as OCLC.
49 * This program is free software; you can redistribute it and/or
50 * modify it under the terms of the GNU General Public License
51 * as published by the Free Software Foundation; either version 2
52 * of the License, or (at your option) any later version.
54 * This program is distributed in the hope that it will be useful,
55 * but WITHOUT ANY WARRANTY; without even the implied warranty of
56 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57 * GNU General Public License for more details.
62 INSERT INTO config.bib_source (quality, source) VALUES (90, 'OcLC');
63 INSERT INTO config.bib_source (quality, source) VALUES (10, 'System Local');
65 CREATE TABLE config.standing (
66 id SERIAL PRIMARY KEY,
67 value TEXT NOT NULL UNIQUE
69 COMMENT ON TABLE config.standing IS $$
71 * Copyright (C) 2005 Georgia Public Library Service
72 * Mike Rylander <mrylander@gmail.com>
76 * This table contains the values that can be applied to a patron
77 * by a staff member. These values should not be changed, other
78 * that for translation, as the ID column is currently a "magic
79 * number" in the source. :(
83 * This program is free software; you can redistribute it and/or
84 * modify it under the terms of the GNU General Public License
85 * as published by the Free Software Foundation; either version 2
86 * of the License, or (at your option) any later version.
88 * This program is distributed in the hope that it will be useful,
89 * but WITHOUT ANY WARRANTY; without even the implied warranty of
90 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91 * GNU General Public License for more details.
95 INSERT INTO config.standing (value) VALUES ('Good');
96 INSERT INTO config.standing (value) VALUES ('Barred');
100 CREATE TABLE config.metabib_field (
101 id SERIAL PRIMARY KEY,
102 field_class TEXT NOT NULL CHECK (lower(field_class) IN ('title','author','subject','keyword','series')),
103 name TEXT NOT NULL UNIQUE,
106 COMMENT ON TABLE config.metabib_field IS $$
108 * Copyright (C) 2005 Georgia Public Library Service
109 * Mike Rylander <mrylander@gmail.com>
111 * XPath used for WoRMing
113 * This table contains the XPath used to chop up MODS into it's
114 * indexable parts. Each XPath entry is named and assigned to
115 * a "class" of either title, subject, author, keyword or series.
120 * This program is free software; you can redistribute it and/or
121 * modify it under the terms of the GNU General Public License
122 * as published by the Free Software Foundation; either version 2
123 * of the License, or (at your option) any later version.
125 * This program is distributed in the hope that it will be useful,
126 * but WITHOUT ANY WARRANTY; without even the implied warranty of
127 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
128 * GNU General Public License for more details.
133 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'series', 'seriestitle', $$//mods:mods/mods:relatedItem[@type="series"]/mods:titleInfo$$ );
134 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'abbreviated', $$//mods:mods/mods:titleInfo[mods:title and (@type='abreviated')]$$ );
135 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'translated', $$//mods:mods/mods:titleInfo[mods:title and (@type='translated')]$$ );
136 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'uniform', $$//mods:mods/mods:titleInfo[mods:title and (@type='uniform')]$$ );
137 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'proper', $$//mods:mods/mods:titleInfo[mods:title and not (@type)]$$ );
138 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']]$$ );
139 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']]$$ );
140 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']]$$ );
141 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'author', 'other', $$//mods:mods/mods:name[@type='personal']/mods:namePart[not(../mods:role)]$$ );
142 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'geographic', $$//mods:mods/mods:subject/mods:geographic$$ );
143 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'name', $$//mods:mods/mods:subject/mods:name$$ );
144 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'temporal', $$//mods:mods/mods:subject/mods:temporal$$ );
145 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'topic', $$//mods:mods/mods:subject/mods:topic$$ );
146 -- INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'genre', $$//mods:mods/mods:genre$$ );
147 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'keyword', 'keyword', $$//mods:mods/*[not(local-name()='originInfo')]$$ ); -- /* to fool vim */
149 CREATE TABLE config.non_cataloged_type (
150 id SERIAL PRIMARY KEY,
151 owning_lib INT NOT NULL, -- REFERENCES actor.org_unit (id),
152 name TEXT NOT NULL UNIQUE,
153 circ_duration INTERVAL NOT NULL DEFAULT '14 days'::INTERVAL
155 COMMENT ON TABLE config.non_cataloged_type IS $$
157 * Copyright (C) 2005 Georgia Public Library Service
158 * Mike Rylander <mrylander@gmail.com>
160 * Types of valid non-cataloged items.
165 * This program is free software; you can redistribute it and/or
166 * modify it under the terms of the GNU General Public License
167 * as published by the Free Software Foundation; either version 2
168 * of the License, or (at your option) any later version.
170 * This program is distributed in the hope that it will be useful,
171 * but WITHOUT ANY WARRANTY; without even the implied warranty of
172 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
173 * GNU General Public License for more details.
178 INSERT INTO config.non_cataloged_type ( owning_lib, name ) VALUES ( 1, 'Paperback Book' );
180 CREATE TABLE config.identification_type (
181 id SERIAL PRIMARY KEY,
182 name TEXT NOT NULL UNIQUE
184 COMMENT ON TABLE config.identification_type IS $$
186 * Copyright (C) 2005 Georgia Public Library Service
187 * Mike Rylander <mrylander@gmail.com>
189 * Types of valid patron identification.
191 * Each patron must display at least one valid form of identification
192 * in order to get a library card. This table lists those forms.
197 * This program is free software; you can redistribute it and/or
198 * modify it under the terms of the GNU General Public License
199 * as published by the Free Software Foundation; either version 2
200 * of the License, or (at your option) any later version.
202 * This program is distributed in the hope that it will be useful,
203 * but WITHOUT ANY WARRANTY; without even the implied warranty of
204 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
205 * GNU General Public License for more details.
210 INSERT INTO config.identification_type ( name ) VALUES ( 'Drivers Licence' );
211 INSERT INTO config.identification_type ( name ) VALUES ( 'Voter Card' );
212 INSERT INTO config.identification_type ( name ) VALUES ( 'Two Utility Bills' );
213 INSERT INTO config.identification_type ( name ) VALUES ( 'State ID' );
214 INSERT INTO config.identification_type ( name ) VALUES ( 'SSN' );
216 CREATE TABLE config.rule_circ_duration (
217 id SERIAL PRIMARY KEY,
218 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
219 extended INTERVAL NOT NULL,
220 normal INTERVAL NOT NULL,
221 shrt INTERVAL NOT NULL,
222 max_renewals INT NOT NULL
224 COMMENT ON TABLE config.rule_circ_duration IS $$
226 * Copyright (C) 2005 Georgia Public Library Service
227 * Mike Rylander <mrylander@gmail.com>
229 * Circulation Duration rules
231 * Each circulation is given a duration based on one of these rules.
236 * This program is free software; you can redistribute it and/or
237 * modify it under the terms of the GNU General Public License
238 * as published by the Free Software Foundation; either version 2
239 * of the License, or (at your option) any later version.
241 * This program is distributed in the hope that it will be useful,
242 * but WITHOUT ANY WARRANTY; without even the implied warranty of
243 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
244 * GNU General Public License for more details.
248 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '2wk_default', '21 days', '14 days', '7 days', 2);
251 CREATE TABLE config.rule_max_fine (
252 id SERIAL PRIMARY KEY,
253 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
254 amount NUMERIC(6,2) NOT NULL
256 COMMENT ON TABLE config.rule_max_fine IS $$
258 * Copyright (C) 2005 Georgia Public Library Service
259 * Mike Rylander <mrylander@gmail.com>
261 * Circulation Max Fine rules
263 * Each circulation is given a maximum fine based on one of
269 * This program is free software; you can redistribute it and/or
270 * modify it under the terms of the GNU General Public License
271 * as published by the Free Software Foundation; either version 2
272 * of the License, or (at your option) any later version.
274 * This program is distributed in the hope that it will be useful,
275 * but WITHOUT ANY WARRANTY; without even the implied warranty of
276 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
277 * GNU General Public License for more details.
281 INSERT INTO config.rule_max_fine VALUES (DEFAULT, 'books', 50.00);
284 CREATE TABLE config.rule_recuring_fine (
285 id SERIAL PRIMARY KEY,
286 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
287 high NUMERIC(6,2) NOT NULL,
288 normal NUMERIC(6,2) NOT NULL,
289 low NUMERIC(6,2) NOT NULL,
290 recurance_interval INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL
292 COMMENT ON TABLE config.rule_recuring_fine IS $$
294 * Copyright (C) 2005 Georgia Public Library Service
295 * Mike Rylander <mrylander@gmail.com>
297 * Circulation Recuring Fine rules
299 * Each circulation is given a recuring fine amount based on one of
300 * these rules. The recurance_interval should not be any shorter
301 * than the interval between runs of the fine_processor.pl script
302 * (which is run from CRON), or you could miss fines.
307 * This program is free software; you can redistribute it and/or
308 * modify it under the terms of the GNU General Public License
309 * as published by the Free Software Foundation; either version 2
310 * of the License, or (at your option) any later version.
312 * This program is distributed in the hope that it will be useful,
313 * but WITHOUT ANY WARRANTY; without even the implied warranty of
314 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
315 * GNU General Public License for more details.
319 INSERT INTO config.rule_recuring_fine VALUES (1, 'books', 0.50, 0.10, 0.10, '1 day');
322 CREATE TABLE config.rule_age_hold_protect (
323 id SERIAL PRIMARY KEY,
324 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
325 age INTERVAL NOT NULL,
328 COMMENT ON TABLE config.rule_age_hold_protect IS $$
330 * Copyright (C) 2005 Georgia Public Library Service
331 * Mike Rylander <mrylander@gmail.com>
333 * Hold Item Age Protection rules
335 * A hold request can only capture new(ish) items when they are
336 * within a particular proximity of the home_ou of the requesting
337 * user. The proximity ('prox' column) is calculated by counting
338 * the number of tree edges beween the user's home_ou and the owning_lib
339 * of the copy that could fulfill the hold.
344 * This program is free software; you can redistribute it and/or
345 * modify it under the terms of the GNU General Public License
346 * as published by the Free Software Foundation; either version 2
347 * of the License, or (at your option) any later version.
349 * This program is distributed in the hope that it will be useful,
350 * but WITHOUT ANY WARRANTY; without even the implied warranty of
351 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
352 * GNU General Public License for more details.
356 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, '3month', '3 mons', 0);
357 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, '6month', '6 mons', 2);
360 CREATE TABLE config.copy_status (
361 id SERIAL PRIMARY KEY,
362 name TEXT NOT NULL UNIQUE,
363 holdable BOOL NOT NULL DEFAULT FALSE
365 COMMENT ON TABLE config.copy_status IS $$
367 * Copyright (C) 2005 Georgia Public Library Service
368 * Mike Rylander <mrylander@gmail.com>
372 * The available copy statuses, and whether a copy in that
373 * status is available for hold request capture. 0 (zero) is
374 * the only special number in this set, meaning that the item
375 * is available for imediate checkout, and is counted as available
378 * Statuses with an ID below 100 are not removable, and have special
379 * meaning in the code. Do not change them except to translate the
382 * You may add and remove statuses above 100, and these can be used
383 * to remove items from normal circulation without affecting the rest
384 * of the copy's values or it's location.
388 * This program is free software; you can redistribute it and/or
389 * modify it under the terms of the GNU General Public License
390 * as published by the Free Software Foundation; either version 2
391 * of the License, or (at your option) any later version.
393 * This program is distributed in the hope that it will be useful,
394 * but WITHOUT ANY WARRANTY; without even the implied warranty of
395 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
396 * GNU General Public License for more details.
400 INSERT INTO config.copy_status (id,name,holdable) VALUES (0,'Available','t');
401 INSERT INTO config.copy_status (name,holdable) VALUES ('Checked out','t');
402 INSERT INTO config.copy_status (name) VALUES ('Bindery');
403 INSERT INTO config.copy_status (name) VALUES ('Lost');
404 INSERT INTO config.copy_status (name) VALUES ('Missing');
405 INSERT INTO config.copy_status (name,holdable) VALUES ('In process','t');
406 INSERT INTO config.copy_status (name,holdable) VALUES ('In transit','t');
407 INSERT INTO config.copy_status (name,holdable) VALUES ('Reshelving','t');
408 INSERT INTO config.copy_status (name) VALUES ('On holds shelf');
409 INSERT INTO config.copy_status (name,holdable) VALUES ('On order','t');
410 INSERT INTO config.copy_status (name) VALUES ('ILL');
411 INSERT INTO config.copy_status (name) VALUES ('Cataloging');
412 INSERT INTO config.copy_status (name) VALUES ('Reserves');
413 INSERT INTO config.copy_status (name) VALUES ('Discard/Weed');
415 SELECT SETVAL('config.copy_status_id_seq'::TEXT, 100);
418 CREATE TABLE config.net_access_level (
419 id SERIAL PRIMARY KEY,
420 name TEXT NOT NULL UNIQUE
422 COMMENT ON TABLE config.net_access_level IS $$
424 * Copyright (C) 2005 Georgia Public Library Service
425 * Mike Rylander <mrylander@gmail.com>
427 * Patron Network Access level
429 * This will be used to inform the in-library firewall of how much
430 * internet access the using patron should be allowed.
434 * This program is free software; you can redistribute it and/or
435 * modify it under the terms of the GNU General Public License
436 * as published by the Free Software Foundation; either version 2
437 * of the License, or (at your option) any later version.
439 * This program is distributed in the hope that it will be useful,
440 * but WITHOUT ANY WARRANTY; without even the implied warranty of
441 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
442 * GNU General Public License for more details.
446 INSERT INTO config.net_access_level (name) VALUES ('Restricted');
447 INSERT INTO config.net_access_level (name) VALUES ('Full');
448 INSERT INTO config.net_access_level (name) VALUES ('None');
450 CREATE TABLE config.audience_map (
451 code "char" PRIMARY KEY,
456 COPY config.audience_map FROM STDIN;
457 Unknown or unspecified The target audience for the item not known or not specified.
458 a Preschool The item is intended for children, approximate ages 0-5 years.
459 b Primary The item is intended for children, approximate ages 6-8 years.
460 c Pre-adolescent The item is intended for young people, approximate ages 9-13 years.
461 d Adolescent The item is intended for young people, approximate ages 14-17 years.
462 e Adult The item is intended for adults.
463 f Specialized The item is aimed at a particular audience and the nature of the presentation makes the item of little interest to another audience.
464 g General The item is of general interest and not aimed at an audience of a particular intellectual level.
465 j Juvenile The item is intended for children and young people, approximate ages 0-15 years.
469 CREATE TABLE config.lit_form_map (
470 code "char" PRIMARY KEY,
475 COPY config.lit_form_map FROM STDIN;
476 0 Not fiction (not further specified) The item is not a work of fiction and no further identification of the literary form is desired
477 1 Fiction (not further specified) The item is a work of fiction and no further identification of the literary form is desired
482 h Humor, satires, etc. The item is a humorous work, satire or of similar literary form.
483 i Letters The item is a single letter or collection of correspondence.
484 j Short stories The item is a short story or collection of short stories.
485 m Mixed forms The item is a variety of literary forms (e.g., poetry and short stories).
486 p Poetry The item is a poem or collection of poems.
487 s Speeches The item is a speech or collection of speeches.
488 u Unknown The literary form of the item is unknown.
491 CREATE TABLE config.language_map (
492 code TEXT PRIMARY KEY,
496 COPY config.language_map FROM STDIN;
503 afa Afroasiatic (Other)
504 afh Afrihili (Artificial language)
511 alg Algonquian (Other)
513 ang English, Old (ca. 450-1100)
517 arg Aragonese Spanish
521 art Artificial (Other)
525 ath Athapascan (Other)
526 aus Australian languages
533 bai Bamileke languages
562 cai Central American Indian (Other)
566 cau Caucasian (Other)
587 cpe Creoles and Pidgins, English-based (Other)
588 cpf Creoles and Pidgins, French-based (Other)
589 cpp Creoles and Pidgins, Portuguese-based (Other)
592 crp Creoles and Pidgins (Other)
605 dra Dravidian (Other)
607 dum Dutch, Middle (ca. 1050-1350)
616 enm English, Middle (1100-1500)
618 -esk Eskimo languages
630 fiu Finno-Ugrian (Other)
634 frm French, Middle (ca. 1400-1600)
635 fro French, Old (ca. 842-1400)
654 gmh German, Middle High (ca. 1050-1500)
655 goh German, Old High (ca. 750-1050)
660 grc Greek, Ancient (to 1453)
661 gre Greek, Modern (1453- )
667 hat Haitian French Creole
689 ina Interlingua (International Auxiliary Language Association)
692 ine Indo-European (Other)
694 -int Interlingua (International Auxiliary Language Association)
698 iro Iroquoian (Other)
740 -lan Occitan (post-1500)
757 luo Luo (Kenya and Tanzania)
768 map Austronesian (Other)
775 mga Irish, Middle (ca. 1100-1550)
778 mis Miscellaneous languages
779 mkh Mon-Khmer (Other)
790 mul Multiple languages
796 nai North American Indian (Other)
797 nap Neapolitan Italian
800 nbl Ndebele (South Africa)
801 nde Ndebele (Zimbabwe)
807 nic Niger-Kordofanian (Other)
809 nno Norwegian (Nynorsk)
810 nob Norwegian (Bokmål)
821 oci Occitan (post-1500)
828 oto Otomian languages
836 peo Old Persian (ca. 600-400 B.C.)
838 phi Philippine (Other)
844 pra Prakrit languages
845 pro Provençal (to 1500)
858 sag Sango (Ubangi Creole)
860 sai South American Indian (Other)
861 sal Salishan languages
862 sam Samaritan Aramaic
872 sga Irish, Old (to 1100)
879 sit Sino-Tibetan (Other)
901 ssa Nilo-Saharan (Other)
962 wak Wakashan languages
967 wen Sorbian languages
985 CREATE TABLE config.item_form_map (
986 code TEXT PRIMARY KEY,
990 COPY config.item_form_map FROM STDIN;
996 r Regular print reproduction
1000 CREATE TABLE config.item_type_map (
1001 code TEXT PRIMARY KEY,
1005 COPY config.item_type_map FROM STDIN;
1007 t Manuscript language material
1009 k Two-dimensional nonprojectable graphic
1010 r Three-dimensional artifact or naturally occurring object
1013 e Cartographic material
1014 f Manuscript cartographic material
1016 d Manuscript notated music
1017 i Nonmusical sound recording
1018 j Musical sound recording