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,
108 COMMENT ON TABLE config.metabib_field IS $$
110 * Copyright (C) 2005 Georgia Public Library Service
111 * Mike Rylander <mrylander@gmail.com>
113 * XPath used for WoRMing
115 * This table contains the XPath used to chop up MODS into it's
116 * indexable parts. Each XPath entry is named and assigned to
117 * a "class" of either title, subject, author, keyword or series.
122 * This program is free software; you can redistribute it and/or
123 * modify it under the terms of the GNU General Public License
124 * as published by the Free Software Foundation; either version 2
125 * of the License, or (at your option) any later version.
127 * This program is distributed in the hope that it will be useful,
128 * but WITHOUT ANY WARRANTY; without even the implied warranty of
129 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
130 * GNU General Public License for more details.
135 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'series', 'seriestitle', $$//mods:mods/mods:relatedItem[@type="series"]/mods:titleInfo$$ );
136 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'abbreviated', $$//mods:mods/mods:titleInfo[mods:title and (@type='abreviated')]$$ );
137 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'translated', $$//mods:mods/mods:titleInfo[mods:title and (@type='translated')]$$ );
138 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'uniform', $$//mods:mods/mods:titleInfo[mods:title and (@type='uniform')]$$ );
139 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'proper', $$//mods:mods/mods:titleInfo[mods:title and not (@type)]$$ );
140 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']]$$ );
141 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']]$$ );
142 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']]$$ );
143 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'author', 'other', $$//mods:mods/mods:name[@type='personal']/mods:namePart[not(../mods:role)]$$ );
144 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'geographic', $$//mods:mods/mods:subject/mods:geographic$$ );
145 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'name', $$//mods:mods/mods:subject/mods:name$$ );
146 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'temporal', $$//mods:mods/mods:subject/mods:temporal$$ );
147 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'topic', $$//mods:mods/mods:subject/mods:topic$$ );
148 -- INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'subject', 'genre', $$//mods:mods/mods:genre$$ );
149 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'keyword', 'keyword', $$//mods:mods/*[not(local-name()='originInfo')]$$ ); -- /* to fool vim */
151 CREATE TABLE config.non_cataloged_type (
152 id SERIAL PRIMARY KEY,
153 owning_lib INT NOT NULL, -- REFERENCES actor.org_unit (id),
154 name TEXT NOT NULL UNIQUE,
155 circ_duration INTERVAL NOT NULL DEFAULT '14 days'::INTERVAL,
156 in_house BOOL NOT NULL DEFAULT FALSE
158 COMMENT ON TABLE config.non_cataloged_type IS $$
160 * Copyright (C) 2005 Georgia Public Library Service
161 * Mike Rylander <mrylander@gmail.com>
163 * Types of valid non-cataloged items.
168 * This program is free software; you can redistribute it and/or
169 * modify it under the terms of the GNU General Public License
170 * as published by the Free Software Foundation; either version 2
171 * of the License, or (at your option) any later version.
173 * This program is distributed in the hope that it will be useful,
174 * but WITHOUT ANY WARRANTY; without even the implied warranty of
175 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
176 * GNU General Public License for more details.
181 INSERT INTO config.non_cataloged_type ( owning_lib, name ) VALUES ( 1, 'Paperback Book' );
183 CREATE TABLE config.identification_type (
184 id SERIAL PRIMARY KEY,
185 name TEXT NOT NULL UNIQUE
187 COMMENT ON TABLE config.identification_type IS $$
189 * Copyright (C) 2005 Georgia Public Library Service
190 * Mike Rylander <mrylander@gmail.com>
192 * Types of valid patron identification.
194 * Each patron must display at least one valid form of identification
195 * in order to get a library card. This table lists those forms.
200 * This program is free software; you can redistribute it and/or
201 * modify it under the terms of the GNU General Public License
202 * as published by the Free Software Foundation; either version 2
203 * of the License, or (at your option) any later version.
205 * This program is distributed in the hope that it will be useful,
206 * but WITHOUT ANY WARRANTY; without even the implied warranty of
207 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
208 * GNU General Public License for more details.
213 INSERT INTO config.identification_type ( name ) VALUES ( 'Drivers Licence' );
214 INSERT INTO config.identification_type ( name ) VALUES ( 'Voter Card' );
215 INSERT INTO config.identification_type ( name ) VALUES ( 'Two Utility Bills' );
216 INSERT INTO config.identification_type ( name ) VALUES ( 'State ID' );
217 INSERT INTO config.identification_type ( name ) VALUES ( 'SSN' );
219 CREATE TABLE config.rule_circ_duration (
220 id SERIAL PRIMARY KEY,
221 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
222 extended INTERVAL NOT NULL,
223 normal INTERVAL NOT NULL,
224 shrt INTERVAL NOT NULL,
225 max_renewals INT NOT NULL
227 COMMENT ON TABLE config.rule_circ_duration IS $$
229 * Copyright (C) 2005 Georgia Public Library Service
230 * Mike Rylander <mrylander@gmail.com>
232 * Circulation Duration rules
234 * Each circulation is given a duration based on one of these rules.
239 * This program is free software; you can redistribute it and/or
240 * modify it under the terms of the GNU General Public License
241 * as published by the Free Software Foundation; either version 2
242 * of the License, or (at your option) any later version.
244 * This program is distributed in the hope that it will be useful,
245 * but WITHOUT ANY WARRANTY; without even the implied warranty of
246 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
247 * GNU General Public License for more details.
251 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '2wk_default', '21 days', '14 days', '7 days', 2);
254 CREATE TABLE config.rule_max_fine (
255 id SERIAL PRIMARY KEY,
256 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
257 amount NUMERIC(6,2) NOT NULL
259 COMMENT ON TABLE config.rule_max_fine IS $$
261 * Copyright (C) 2005 Georgia Public Library Service
262 * Mike Rylander <mrylander@gmail.com>
264 * Circulation Max Fine rules
266 * Each circulation is given a maximum fine based on one of
272 * This program is free software; you can redistribute it and/or
273 * modify it under the terms of the GNU General Public License
274 * as published by the Free Software Foundation; either version 2
275 * of the License, or (at your option) any later version.
277 * This program is distributed in the hope that it will be useful,
278 * but WITHOUT ANY WARRANTY; without even the implied warranty of
279 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
280 * GNU General Public License for more details.
284 INSERT INTO config.rule_max_fine VALUES (DEFAULT, 'books', 50.00);
287 CREATE TABLE config.rule_recuring_fine (
288 id SERIAL PRIMARY KEY,
289 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
290 high NUMERIC(6,2) NOT NULL,
291 normal NUMERIC(6,2) NOT NULL,
292 low NUMERIC(6,2) NOT NULL,
293 recurance_interval INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL
295 COMMENT ON TABLE config.rule_recuring_fine IS $$
297 * Copyright (C) 2005 Georgia Public Library Service
298 * Mike Rylander <mrylander@gmail.com>
300 * Circulation Recuring Fine rules
302 * Each circulation is given a recuring fine amount based on one of
303 * these rules. The recurance_interval should not be any shorter
304 * than the interval between runs of the fine_processor.pl script
305 * (which is run from CRON), or you could miss fines.
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 config.rule_recuring_fine VALUES (1, 'books', 0.50, 0.10, 0.10, '1 day');
325 CREATE TABLE config.rule_age_hold_protect (
326 id SERIAL PRIMARY KEY,
327 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
328 age INTERVAL NOT NULL,
331 COMMENT ON TABLE config.rule_age_hold_protect IS $$
333 * Copyright (C) 2005 Georgia Public Library Service
334 * Mike Rylander <mrylander@gmail.com>
336 * Hold Item Age Protection rules
338 * A hold request can only capture new(ish) items when they are
339 * within a particular proximity of the home_ou of the requesting
340 * user. The proximity ('prox' column) is calculated by counting
341 * the number of tree edges beween the user's home_ou and the owning_lib
342 * of the copy that could fulfill the hold.
347 * This program is free software; you can redistribute it and/or
348 * modify it under the terms of the GNU General Public License
349 * as published by the Free Software Foundation; either version 2
350 * of the License, or (at your option) any later version.
352 * This program is distributed in the hope that it will be useful,
353 * but WITHOUT ANY WARRANTY; without even the implied warranty of
354 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
355 * GNU General Public License for more details.
359 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, '3month', '3 mons', 0);
360 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, '6month', '6 mons', 2);
363 CREATE TABLE config.copy_status (
364 id SERIAL PRIMARY KEY,
365 name TEXT NOT NULL UNIQUE,
366 holdable BOOL NOT NULL DEFAULT FALSE
368 COMMENT ON TABLE config.copy_status IS $$
370 * Copyright (C) 2005 Georgia Public Library Service
371 * Mike Rylander <mrylander@gmail.com>
375 * The available copy statuses, and whether a copy in that
376 * status is available for hold request capture. 0 (zero) is
377 * the only special number in this set, meaning that the item
378 * is available for imediate checkout, and is counted as available
381 * Statuses with an ID below 100 are not removable, and have special
382 * meaning in the code. Do not change them except to translate the
385 * You may add and remove statuses above 100, and these can be used
386 * to remove items from normal circulation without affecting the rest
387 * of the copy's values or it's location.
391 * This program is free software; you can redistribute it and/or
392 * modify it under the terms of the GNU General Public License
393 * as published by the Free Software Foundation; either version 2
394 * of the License, or (at your option) any later version.
396 * This program is distributed in the hope that it will be useful,
397 * but WITHOUT ANY WARRANTY; without even the implied warranty of
398 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
399 * GNU General Public License for more details.
403 INSERT INTO config.copy_status (id,name,holdable) VALUES (0,'Available','t');
404 INSERT INTO config.copy_status (name,holdable) VALUES ('Checked out','t');
405 INSERT INTO config.copy_status (name) VALUES ('Bindery');
406 INSERT INTO config.copy_status (name) VALUES ('Lost');
407 INSERT INTO config.copy_status (name) VALUES ('Missing');
408 INSERT INTO config.copy_status (name,holdable) VALUES ('In process','t');
409 INSERT INTO config.copy_status (name,holdable) VALUES ('In transit','t');
410 INSERT INTO config.copy_status (name,holdable) VALUES ('Reshelving','t');
411 INSERT INTO config.copy_status (name) VALUES ('On holds shelf');
412 INSERT INTO config.copy_status (name,holdable) VALUES ('On order','t');
413 INSERT INTO config.copy_status (name) VALUES ('ILL');
414 INSERT INTO config.copy_status (name) VALUES ('Cataloging');
415 INSERT INTO config.copy_status (name) VALUES ('Reserves');
416 INSERT INTO config.copy_status (name) VALUES ('Discard/Weed');
418 SELECT SETVAL('config.copy_status_id_seq'::TEXT, 100);
421 CREATE TABLE config.net_access_level (
422 id SERIAL PRIMARY KEY,
423 name TEXT NOT NULL UNIQUE
425 COMMENT ON TABLE config.net_access_level IS $$
427 * Copyright (C) 2005 Georgia Public Library Service
428 * Mike Rylander <mrylander@gmail.com>
430 * Patron Network Access level
432 * This will be used to inform the in-library firewall of how much
433 * internet access the using patron should be allowed.
437 * This program is free software; you can redistribute it and/or
438 * modify it under the terms of the GNU General Public License
439 * as published by the Free Software Foundation; either version 2
440 * of the License, or (at your option) any later version.
442 * This program is distributed in the hope that it will be useful,
443 * but WITHOUT ANY WARRANTY; without even the implied warranty of
444 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
445 * GNU General Public License for more details.
449 INSERT INTO config.net_access_level (name) VALUES ('Restricted');
450 INSERT INTO config.net_access_level (name) VALUES ('Full');
451 INSERT INTO config.net_access_level (name) VALUES ('None');
453 CREATE TABLE config.audience_map (
454 code "char" PRIMARY KEY,
459 COPY config.audience_map FROM STDIN;
460 Unknown or unspecified The target audience for the item not known or not specified.
461 a Preschool The item is intended for children, approximate ages 0-5 years.
462 b Primary The item is intended for children, approximate ages 6-8 years.
463 c Pre-adolescent The item is intended for young people, approximate ages 9-13 years.
464 d Adolescent The item is intended for young people, approximate ages 14-17 years.
465 e Adult The item is intended for adults.
466 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.
467 g General The item is of general interest and not aimed at an audience of a particular intellectual level.
468 j Juvenile The item is intended for children and young people, approximate ages 0-15 years.
472 CREATE TABLE config.lit_form_map (
473 code "char" PRIMARY KEY,
478 COPY config.lit_form_map FROM STDIN;
479 0 Not fiction (not further specified) The item is not a work of fiction and no further identification of the literary form is desired
480 1 Fiction (not further specified) The item is a work of fiction and no further identification of the literary form is desired
485 h Humor, satires, etc. The item is a humorous work, satire or of similar literary form.
486 i Letters The item is a single letter or collection of correspondence.
487 j Short stories The item is a short story or collection of short stories.
488 m Mixed forms The item is a variety of literary forms (e.g., poetry and short stories).
489 p Poetry The item is a poem or collection of poems.
490 s Speeches The item is a speech or collection of speeches.
491 u Unknown The literary form of the item is unknown.
494 CREATE TABLE config.language_map (
495 code TEXT PRIMARY KEY,
499 COPY config.language_map FROM STDIN;
506 afa Afroasiatic (Other)
507 afh Afrihili (Artificial language)
514 alg Algonquian (Other)
516 ang English, Old (ca. 450-1100)
520 arg Aragonese Spanish
524 art Artificial (Other)
528 ath Athapascan (Other)
529 aus Australian languages
536 bai Bamileke languages
565 cai Central American Indian (Other)
569 cau Caucasian (Other)
590 cpe Creoles and Pidgins, English-based (Other)
591 cpf Creoles and Pidgins, French-based (Other)
592 cpp Creoles and Pidgins, Portuguese-based (Other)
595 crp Creoles and Pidgins (Other)
608 dra Dravidian (Other)
610 dum Dutch, Middle (ca. 1050-1350)
619 enm English, Middle (1100-1500)
621 -esk Eskimo languages
633 fiu Finno-Ugrian (Other)
637 frm French, Middle (ca. 1400-1600)
638 fro French, Old (ca. 842-1400)
657 gmh German, Middle High (ca. 1050-1500)
658 goh German, Old High (ca. 750-1050)
663 grc Greek, Ancient (to 1453)
664 gre Greek, Modern (1453- )
670 hat Haitian French Creole
692 ina Interlingua (International Auxiliary Language Association)
695 ine Indo-European (Other)
697 -int Interlingua (International Auxiliary Language Association)
701 iro Iroquoian (Other)
743 -lan Occitan (post-1500)
760 luo Luo (Kenya and Tanzania)
771 map Austronesian (Other)
778 mga Irish, Middle (ca. 1100-1550)
781 mis Miscellaneous languages
782 mkh Mon-Khmer (Other)
793 mul Multiple languages
799 nai North American Indian (Other)
800 nap Neapolitan Italian
803 nbl Ndebele (South Africa)
804 nde Ndebele (Zimbabwe)
810 nic Niger-Kordofanian (Other)
812 nno Norwegian (Nynorsk)
813 nob Norwegian (Bokmål)
824 oci Occitan (post-1500)
831 oto Otomian languages
839 peo Old Persian (ca. 600-400 B.C.)
841 phi Philippine (Other)
847 pra Prakrit languages
848 pro Provençal (to 1500)
861 sag Sango (Ubangi Creole)
863 sai South American Indian (Other)
864 sal Salishan languages
865 sam Samaritan Aramaic
875 sga Irish, Old (to 1100)
882 sit Sino-Tibetan (Other)
904 ssa Nilo-Saharan (Other)
965 wak Wakashan languages
970 wen Sorbian languages
988 CREATE TABLE config.item_form_map (
989 code TEXT PRIMARY KEY,
993 COPY config.item_form_map FROM STDIN;
999 r Regular print reproduction
1003 CREATE TABLE config.item_type_map (
1004 code TEXT PRIMARY KEY,
1008 COPY config.item_type_map FROM STDIN;
1010 t Manuscript language material
1012 k Two-dimensional nonprojectable graphic
1013 r Three-dimensional artifact or naturally occurring object
1016 e Cartographic material
1017 f Manuscript cartographic material
1019 d Manuscript notated music
1020 i Nonmusical sound recording
1021 j Musical sound recording