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,
36 transcendant BOOL NOT NULL DEFAULT FALSE
38 COMMENT ON TABLE config.bib_source IS $$
40 * Copyright (C) 2005 Georgia Public Library Service
41 * Mike Rylander <mrylander@gmail.com>
43 * Valid sources of MARC records
45 * This is table is used to set up the relative "quality" of each
46 * MARC source, such as OCLC.
50 * This program is free software; you can redistribute it and/or
51 * modify it under the terms of the GNU General Public License
52 * as published by the Free Software Foundation; either version 2
53 * of the License, or (at your option) any later version.
55 * This program is distributed in the hope that it will be useful,
56 * but WITHOUT ANY WARRANTY; without even the implied warranty of
57 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58 * GNU General Public License for more details.
63 INSERT INTO config.bib_source (quality, source) VALUES (90, 'oclc');
64 INSERT INTO config.bib_source (quality, source) VALUES (10, 'System Local');
65 INSERT INTO config.bib_source (quality, source, transcendant) VALUES (1, 'Project Gutenberg', TRUE);
67 CREATE TABLE config.standing (
68 id SERIAL PRIMARY KEY,
69 value TEXT NOT NULL UNIQUE
71 COMMENT ON TABLE config.standing IS $$
73 * Copyright (C) 2005 Georgia Public Library Service
74 * Mike Rylander <mrylander@gmail.com>
78 * This table contains the values that can be applied to a patron
79 * by a staff member. These values should not be changed, other
80 * that for translation, as the ID column is currently a "magic
81 * number" in the source. :(
85 * This program is free software; you can redistribute it and/or
86 * modify it under the terms of the GNU General Public License
87 * as published by the Free Software Foundation; either version 2
88 * of the License, or (at your option) any later version.
90 * This program is distributed in the hope that it will be useful,
91 * but WITHOUT ANY WARRANTY; without even the implied warranty of
92 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93 * GNU General Public License for more details.
97 INSERT INTO config.standing (value) VALUES ('Good');
98 INSERT INTO config.standing (value) VALUES ('Barred');
102 CREATE TABLE config.metabib_field (
103 id SERIAL PRIMARY KEY,
104 field_class TEXT NOT NULL CHECK (lower(field_class) IN ('title','author','subject','keyword','series')),
105 name TEXT NOT NULL UNIQUE,
107 weight INT NOT NULL DEFAULT 1,
108 format TEXT NOT NULL DEFAULT 'mods'
110 COMMENT ON TABLE config.metabib_field IS $$
112 * Copyright (C) 2005 Georgia Public Library Service
113 * Mike Rylander <mrylander@gmail.com>
115 * XPath used for WoRMing
117 * This table contains the XPath used to chop up MODS into it's
118 * indexable parts. Each XPath entry is named and assigned to
119 * a "class" of either title, subject, author, keyword or series.
124 * This program is free software; you can redistribute it and/or
125 * modify it under the terms of the GNU General Public License
126 * as published by the Free Software Foundation; either version 2
127 * of the License, or (at your option) any later version.
129 * This program is distributed in the hope that it will be useful,
130 * but WITHOUT ANY WARRANTY; without even the implied warranty of
131 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
132 * GNU General Public License for more details.
137 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'series', 'seriestitle', $$//mods:mods/mods:relatedItem[@type="series"]/mods:titleInfo$$ );
138 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'abbreviated', $$//mods:mods/mods:titleInfo[mods:title and (@type='abreviated')]$$ );
139 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'translated', $$//mods:mods/mods:titleInfo[mods:title and (@type='translated')]$$ );
140 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'uniform', $$//mods:mods/mods:titleInfo[mods:title and (@type='uniform')]$$ );
141 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'proper', $$//mods:mods/mods:titleInfo[mods:title and not (@type)]$$ );
142 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']]$$ );
143 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']]$$ );
144 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']]$$ );
145 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'author', 'other', $$//mods:mods/mods:name[@type='personal']/mods:namePart[not(../mods:role)]$$ );
146 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'geographic', $$//mods:mods/mods:subject/mods:geographic$$ );
147 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'name', $$//mods:mods/mods:subject/mods:name$$ );
148 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'temporal', $$//mods:mods/mods:subject/mods:temporal$$ );
149 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'topic', $$//mods:mods/mods:subject/mods:topic$$ );
150 -- INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'genre', $$//mods:mods/mods:genre$$ );
151 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'keyword', 'keyword', $$//mods:mods/*[not(local-name()='originInfo')]$$ ); -- /* to fool vim */
153 CREATE TABLE config.non_cataloged_type (
154 id SERIAL PRIMARY KEY,
155 owning_lib INT NOT NULL, -- REFERENCES actor.org_unit (id),
157 circ_duration INTERVAL NOT NULL DEFAULT '14 days'::INTERVAL,
158 in_house BOOL NOT NULL DEFAULT FALSE,
159 CONSTRAINT noncat_once_per_lib UNIQUE (owning_lib,name)
161 COMMENT ON TABLE config.non_cataloged_type IS $$
163 * Copyright (C) 2005 Georgia Public Library Service
164 * Mike Rylander <mrylander@gmail.com>
166 * Types of valid non-cataloged items.
171 * This program is free software; you can redistribute it and/or
172 * modify it under the terms of the GNU General Public License
173 * as published by the Free Software Foundation; either version 2
174 * of the License, or (at your option) any later version.
176 * This program is distributed in the hope that it will be useful,
177 * but WITHOUT ANY WARRANTY; without even the implied warranty of
178 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
179 * GNU General Public License for more details.
184 INSERT INTO config.non_cataloged_type ( owning_lib, name ) VALUES ( 1, 'Paperback Book' );
186 CREATE TABLE config.identification_type (
187 id SERIAL PRIMARY KEY,
188 name TEXT NOT NULL UNIQUE
190 COMMENT ON TABLE config.identification_type IS $$
192 * Copyright (C) 2005 Georgia Public Library Service
193 * Mike Rylander <mrylander@gmail.com>
195 * Types of valid patron identification.
197 * Each patron must display at least one valid form of identification
198 * in order to get a library card. This table lists those forms.
203 * This program is free software; you can redistribute it and/or
204 * modify it under the terms of the GNU General Public License
205 * as published by the Free Software Foundation; either version 2
206 * of the License, or (at your option) any later version.
208 * This program is distributed in the hope that it will be useful,
209 * but WITHOUT ANY WARRANTY; without even the implied warranty of
210 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
211 * GNU General Public License for more details.
216 INSERT INTO config.identification_type ( name ) VALUES ( 'Drivers Licence' );
217 INSERT INTO config.identification_type ( name ) VALUES ( 'Voter Card' );
218 INSERT INTO config.identification_type ( name ) VALUES ( 'Two Utility Bills' );
219 INSERT INTO config.identification_type ( name ) VALUES ( 'State ID' );
220 INSERT INTO config.identification_type ( name ) VALUES ( 'SSN' );
222 CREATE TABLE config.rule_circ_duration (
223 id SERIAL PRIMARY KEY,
224 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
225 extended INTERVAL NOT NULL,
226 normal INTERVAL NOT NULL,
227 shrt INTERVAL NOT NULL,
228 max_renewals INT NOT NULL
230 COMMENT ON TABLE config.rule_circ_duration IS $$
232 * Copyright (C) 2005 Georgia Public Library Service
233 * Mike Rylander <mrylander@gmail.com>
235 * Circulation Duration rules
237 * Each circulation is given a duration based on one of these rules.
242 * This program is free software; you can redistribute it and/or
243 * modify it under the terms of the GNU General Public License
244 * as published by the Free Software Foundation; either version 2
245 * of the License, or (at your option) any later version.
247 * This program is distributed in the hope that it will be useful,
248 * but WITHOUT ANY WARRANTY; without even the implied warranty of
249 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
250 * GNU General Public License for more details.
254 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '2wk_default', '21 days', '14 days', '7 days', 2);
257 CREATE TABLE config.rule_max_fine (
258 id SERIAL PRIMARY KEY,
259 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
260 amount NUMERIC(6,2) NOT NULL
262 COMMENT ON TABLE config.rule_max_fine IS $$
264 * Copyright (C) 2005 Georgia Public Library Service
265 * Mike Rylander <mrylander@gmail.com>
267 * Circulation Max Fine rules
269 * Each circulation is given a maximum fine based on one of
275 * This program is free software; you can redistribute it and/or
276 * modify it under the terms of the GNU General Public License
277 * as published by the Free Software Foundation; either version 2
278 * of the License, or (at your option) any later version.
280 * This program is distributed in the hope that it will be useful,
281 * but WITHOUT ANY WARRANTY; without even the implied warranty of
282 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
283 * GNU General Public License for more details.
287 INSERT INTO config.rule_max_fine VALUES (DEFAULT, 'books', 50.00);
290 CREATE TABLE config.rule_recuring_fine (
291 id SERIAL PRIMARY KEY,
292 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
293 high NUMERIC(6,2) NOT NULL,
294 normal NUMERIC(6,2) NOT NULL,
295 low NUMERIC(6,2) NOT NULL,
296 recurance_interval INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL
298 COMMENT ON TABLE config.rule_recuring_fine IS $$
300 * Copyright (C) 2005 Georgia Public Library Service
301 * Mike Rylander <mrylander@gmail.com>
303 * Circulation Recuring Fine rules
305 * Each circulation is given a recuring fine amount based on one of
306 * these rules. The recurance_interval should not be any shorter
307 * than the interval between runs of the fine_processor.pl script
308 * (which is run from CRON), or you could miss fines.
313 * This program is free software; you can redistribute it and/or
314 * modify it under the terms of the GNU General Public License
315 * as published by the Free Software Foundation; either version 2
316 * of the License, or (at your option) any later version.
318 * This program is distributed in the hope that it will be useful,
319 * but WITHOUT ANY WARRANTY; without even the implied warranty of
320 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
321 * GNU General Public License for more details.
325 INSERT INTO config.rule_recuring_fine VALUES (1, 'books', 0.50, 0.10, 0.10, '1 day');
328 CREATE TABLE config.rule_age_hold_protect (
329 id SERIAL PRIMARY KEY,
330 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
331 age INTERVAL NOT NULL,
334 COMMENT ON TABLE config.rule_age_hold_protect IS $$
336 * Copyright (C) 2005 Georgia Public Library Service
337 * Mike Rylander <mrylander@gmail.com>
339 * Hold Item Age Protection rules
341 * A hold request can only capture new(ish) items when they are
342 * within a particular proximity of the home_ou of the requesting
343 * user. The proximity ('prox' column) is calculated by counting
344 * the number of tree edges beween the user's home_ou and the owning_lib
345 * of the copy that could fulfill the hold.
350 * This program is free software; you can redistribute it and/or
351 * modify it under the terms of the GNU General Public License
352 * as published by the Free Software Foundation; either version 2
353 * of the License, or (at your option) any later version.
355 * This program is distributed in the hope that it will be useful,
356 * but WITHOUT ANY WARRANTY; without even the implied warranty of
357 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
358 * GNU General Public License for more details.
362 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, '3month', '3 mons', 0);
363 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, '6month', '6 mons', 2);
366 CREATE TABLE config.copy_status (
367 id SERIAL PRIMARY KEY,
368 name TEXT NOT NULL UNIQUE,
369 holdable BOOL NOT NULL DEFAULT FALSE
371 COMMENT ON TABLE config.copy_status IS $$
373 * Copyright (C) 2005 Georgia Public Library Service
374 * Mike Rylander <mrylander@gmail.com>
378 * The available copy statuses, and whether a copy in that
379 * status is available for hold request capture. 0 (zero) is
380 * the only special number in this set, meaning that the item
381 * is available for imediate checkout, and is counted as available
384 * Statuses with an ID below 100 are not removable, and have special
385 * meaning in the code. Do not change them except to translate the
388 * You may add and remove statuses above 100, and these can be used
389 * to remove items from normal circulation without affecting the rest
390 * of the copy's values or it's location.
394 * This program is free software; you can redistribute it and/or
395 * modify it under the terms of the GNU General Public License
396 * as published by the Free Software Foundation; either version 2
397 * of the License, or (at your option) any later version.
399 * This program is distributed in the hope that it will be useful,
400 * but WITHOUT ANY WARRANTY; without even the implied warranty of
401 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
402 * GNU General Public License for more details.
406 INSERT INTO config.copy_status (id,name,holdable) VALUES (0,'Available','t');
407 INSERT INTO config.copy_status (name,holdable) VALUES ('Checked out','t');
408 INSERT INTO config.copy_status (name) VALUES ('Bindery');
409 INSERT INTO config.copy_status (name) VALUES ('Lost');
410 INSERT INTO config.copy_status (name) VALUES ('Missing');
411 INSERT INTO config.copy_status (name,holdable) VALUES ('In process','t');
412 INSERT INTO config.copy_status (name,holdable) VALUES ('In transit','t');
413 INSERT INTO config.copy_status (name,holdable) VALUES ('Reshelving','t');
414 INSERT INTO config.copy_status (name,holdable) VALUES ('On holds shelf','t');
415 INSERT INTO config.copy_status (name,holdable) VALUES ('On order','t');
416 INSERT INTO config.copy_status (name) VALUES ('ILL');
417 INSERT INTO config.copy_status (name) VALUES ('Cataloging');
418 INSERT INTO config.copy_status (name) VALUES ('Reserves');
419 INSERT INTO config.copy_status (name) VALUES ('Discard/Weed');
421 SELECT SETVAL('config.copy_status_id_seq'::TEXT, 100);
424 CREATE TABLE config.net_access_level (
425 id SERIAL PRIMARY KEY,
426 name TEXT NOT NULL UNIQUE
428 COMMENT ON TABLE config.net_access_level IS $$
430 * Copyright (C) 2005 Georgia Public Library Service
431 * Mike Rylander <mrylander@gmail.com>
433 * Patron Network Access level
435 * This will be used to inform the in-library firewall of how much
436 * internet access the using patron should be allowed.
440 * This program is free software; you can redistribute it and/or
441 * modify it under the terms of the GNU General Public License
442 * as published by the Free Software Foundation; either version 2
443 * of the License, or (at your option) any later version.
445 * This program is distributed in the hope that it will be useful,
446 * but WITHOUT ANY WARRANTY; without even the implied warranty of
447 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
448 * GNU General Public License for more details.
452 INSERT INTO config.net_access_level (name) VALUES ('Filtered');
453 INSERT INTO config.net_access_level (name) VALUES ('Unfiltered');
454 INSERT INTO config.net_access_level (name) VALUES ('No Access');
456 CREATE TABLE config.audience_map (
457 code TEXT PRIMARY KEY,
462 COPY config.audience_map FROM STDIN;
463 Unknown or unspecified The target audience for the item not known or not specified.
464 a Preschool The item is intended for children, approximate ages 0-5 years.
465 b Primary The item is intended for children, approximate ages 6-8 years.
466 c Pre-adolescent The item is intended for young people, approximate ages 9-13 years.
467 d Adolescent The item is intended for young people, approximate ages 14-17 years.
468 e Adult The item is intended for adults.
469 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.
470 g General The item is of general interest and not aimed at an audience of a particular intellectual level.
471 j Juvenile The item is intended for children and young people, approximate ages 0-15 years.
475 CREATE TABLE config.lit_form_map (
476 code TEXT PRIMARY KEY,
481 COPY config.lit_form_map FROM STDIN;
482 0 Not fiction (not further specified) The item is not a work of fiction and no further identification of the literary form is desired
483 1 Fiction (not further specified) The item is a work of fiction and no further identification of the literary form is desired
488 h Humor, satires, etc. The item is a humorous work, satire or of similar literary form.
489 i Letters The item is a single letter or collection of correspondence.
490 j Short stories The item is a short story or collection of short stories.
491 m Mixed forms The item is a variety of literary forms (e.g., poetry and short stories).
492 p Poetry The item is a poem or collection of poems.
493 s Speeches The item is a speech or collection of speeches.
494 u Unknown The literary form of the item is unknown.
497 CREATE TABLE config.language_map (
498 code TEXT PRIMARY KEY,
502 COPY config.language_map FROM STDIN;
509 afa Afroasiatic (Other)
510 afh Afrihili (Artificial language)
517 alg Algonquian (Other)
519 ang English, Old (ca. 450-1100)
523 arg Aragonese Spanish
527 art Artificial (Other)
531 ath Athapascan (Other)
532 aus Australian languages
539 bai Bamileke languages
568 cai Central American Indian (Other)
572 cau Caucasian (Other)
593 cpe Creoles and Pidgins, English-based (Other)
594 cpf Creoles and Pidgins, French-based (Other)
595 cpp Creoles and Pidgins, Portuguese-based (Other)
598 crp Creoles and Pidgins (Other)
611 dra Dravidian (Other)
613 dum Dutch, Middle (ca. 1050-1350)
622 enm English, Middle (1100-1500)
624 -esk Eskimo languages
636 fiu Finno-Ugrian (Other)
640 frm French, Middle (ca. 1400-1600)
641 fro French, Old (ca. 842-1400)
660 gmh German, Middle High (ca. 1050-1500)
661 goh German, Old High (ca. 750-1050)
666 grc Greek, Ancient (to 1453)
667 gre Greek, Modern (1453- )
673 hat Haitian French Creole
695 ina Interlingua (International Auxiliary Language Association)
698 ine Indo-European (Other)
700 -int Interlingua (International Auxiliary Language Association)
704 iro Iroquoian (Other)
746 -lan Occitan (post-1500)
763 luo Luo (Kenya and Tanzania)
774 map Austronesian (Other)
781 mga Irish, Middle (ca. 1100-1550)
784 mis Miscellaneous languages
785 mkh Mon-Khmer (Other)
796 mul Multiple languages
802 nai North American Indian (Other)
803 nap Neapolitan Italian
806 nbl Ndebele (South Africa)
807 nde Ndebele (Zimbabwe)
813 nic Niger-Kordofanian (Other)
815 nno Norwegian (Nynorsk)
816 nob Norwegian (Bokmål)
827 oci Occitan (post-1500)
834 oto Otomian languages
842 peo Old Persian (ca. 600-400 B.C.)
844 phi Philippine (Other)
850 pra Prakrit languages
851 pro Provençal (to 1500)
864 sag Sango (Ubangi Creole)
866 sai South American Indian (Other)
867 sal Salishan languages
868 sam Samaritan Aramaic
878 sga Irish, Old (to 1100)
885 sit Sino-Tibetan (Other)
907 ssa Nilo-Saharan (Other)
968 wak Wakashan languages
973 wen Sorbian languages
991 CREATE TABLE config.item_form_map (
992 code TEXT PRIMARY KEY,
996 COPY config.item_form_map FROM STDIN;
1002 r Regular print reproduction
1006 CREATE TABLE config.item_type_map (
1007 code TEXT PRIMARY KEY,
1011 COPY config.item_type_map FROM STDIN;
1013 t Manuscript language material
1015 k Two-dimensional nonprojectable graphic
1016 r Three-dimensional artifact or naturally occurring object
1019 e Cartographic material
1020 f Manuscript cartographic material
1022 d Manuscript notated music
1023 i Nonmusical sound recording
1024 j Musical sound recording