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
154 COMMENT ON TABLE config.non_cataloged_type IS $$
156 * Copyright (C) 2005 Georgia Public Library Service
157 * Mike Rylander <mrylander@gmail.com>
159 * Types of valid non-cataloged items.
164 * This program is free software; you can redistribute it and/or
165 * modify it under the terms of the GNU General Public License
166 * as published by the Free Software Foundation; either version 2
167 * of the License, or (at your option) any later version.
169 * This program is distributed in the hope that it will be useful,
170 * but WITHOUT ANY WARRANTY; without even the implied warranty of
171 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
172 * GNU General Public License for more details.
177 INSERT INTO config.non_cataloged_type ( owning_lib, name ) VALUES ( 1, 'Paperback Book' );
179 CREATE TABLE config.identification_type (
180 id SERIAL PRIMARY KEY,
181 name TEXT NOT NULL UNIQUE
183 COMMENT ON TABLE config.identification_type IS $$
185 * Copyright (C) 2005 Georgia Public Library Service
186 * Mike Rylander <mrylander@gmail.com>
188 * Types of valid patron identification.
190 * Each patron must display at least one valid form of identification
191 * in order to get a library card. This table lists those forms.
196 * This program is free software; you can redistribute it and/or
197 * modify it under the terms of the GNU General Public License
198 * as published by the Free Software Foundation; either version 2
199 * of the License, or (at your option) any later version.
201 * This program is distributed in the hope that it will be useful,
202 * but WITHOUT ANY WARRANTY; without even the implied warranty of
203 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
204 * GNU General Public License for more details.
209 INSERT INTO config.identification_type ( name ) VALUES ( 'Drivers Licence' );
210 INSERT INTO config.identification_type ( name ) VALUES ( 'Voter Card' );
211 INSERT INTO config.identification_type ( name ) VALUES ( 'Two Utility Bills' );
212 INSERT INTO config.identification_type ( name ) VALUES ( 'State ID' );
213 INSERT INTO config.identification_type ( name ) VALUES ( 'SSN' );
215 CREATE TABLE config.rule_circ_duration (
216 id SERIAL PRIMARY KEY,
217 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
218 extended INTERVAL NOT NULL,
219 normal INTERVAL NOT NULL,
220 shrt INTERVAL NOT NULL,
221 max_renewals INT NOT NULL
223 COMMENT ON TABLE config.rule_circ_duration IS $$
225 * Copyright (C) 2005 Georgia Public Library Service
226 * Mike Rylander <mrylander@gmail.com>
228 * Circulation Duration rules
230 * Each circulation is given a duration based on one of these rules.
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 config.rule_circ_duration VALUES (DEFAULT, '2wk_default', '21 days', '14 days', '7 days', 2);
250 CREATE TABLE config.rule_max_fine (
251 id SERIAL PRIMARY KEY,
252 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
253 amount NUMERIC(6,2) NOT NULL
255 COMMENT ON TABLE config.rule_max_fine IS $$
257 * Copyright (C) 2005 Georgia Public Library Service
258 * Mike Rylander <mrylander@gmail.com>
260 * Circulation Max Fine rules
262 * Each circulation is given a maximum fine based on one of
268 * This program is free software; you can redistribute it and/or
269 * modify it under the terms of the GNU General Public License
270 * as published by the Free Software Foundation; either version 2
271 * of the License, or (at your option) any later version.
273 * This program is distributed in the hope that it will be useful,
274 * but WITHOUT ANY WARRANTY; without even the implied warranty of
275 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
276 * GNU General Public License for more details.
280 INSERT INTO config.rule_max_fine VALUES (DEFAULT, 'books', 50.00);
283 CREATE TABLE config.rule_recuring_fine (
284 id SERIAL PRIMARY KEY,
285 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
286 high NUMERIC(6,2) NOT NULL,
287 normal NUMERIC(6,2) NOT NULL,
288 low NUMERIC(6,2) NOT NULL,
289 recurance_interval INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL
291 COMMENT ON TABLE config.rule_recuring_fine IS $$
293 * Copyright (C) 2005 Georgia Public Library Service
294 * Mike Rylander <mrylander@gmail.com>
296 * Circulation Recuring Fine rules
298 * Each circulation is given a recuring fine amount based on one of
299 * these rules. The recurance_interval should not be any shorter
300 * than the interval between runs of the fine_processor.pl script
301 * (which is run from CRON), or you could miss fines.
306 * This program is free software; you can redistribute it and/or
307 * modify it under the terms of the GNU General Public License
308 * as published by the Free Software Foundation; either version 2
309 * of the License, or (at your option) any later version.
311 * This program is distributed in the hope that it will be useful,
312 * but WITHOUT ANY WARRANTY; without even the implied warranty of
313 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
314 * GNU General Public License for more details.
318 INSERT INTO config.rule_recuring_fine VALUES (1, 'books', 0.50, 0.10, 0.10, '1 day');
321 CREATE TABLE config.rule_age_hold_protect (
322 id SERIAL PRIMARY KEY,
323 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
324 age INTERVAL NOT NULL,
327 COMMENT ON TABLE config.rule_age_hold_protect IS $$
329 * Copyright (C) 2005 Georgia Public Library Service
330 * Mike Rylander <mrylander@gmail.com>
332 * Hold Item Age Protection rules
334 * A hold request can only capture new(ish) items when they are
335 * within a particular proximity of the home_ou of the requesting
336 * user. The proximity ('prox' column) is calculated by counting
337 * the number of tree edges beween the user's home_ou and the owning_lib
338 * of the copy that could fulfill the hold.
343 * This program is free software; you can redistribute it and/or
344 * modify it under the terms of the GNU General Public License
345 * as published by the Free Software Foundation; either version 2
346 * of the License, or (at your option) any later version.
348 * This program is distributed in the hope that it will be useful,
349 * but WITHOUT ANY WARRANTY; without even the implied warranty of
350 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
351 * GNU General Public License for more details.
355 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, '3month', '3 mons', 0);
356 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, '6month', '6 mons', 2);
359 CREATE TABLE config.copy_status (
360 id SERIAL PRIMARY KEY,
361 name TEXT NOT NULL UNIQUE,
362 holdable BOOL NOT NULL DEFAULT FALSE
364 COMMENT ON TABLE config.copy_status IS $$
366 * Copyright (C) 2005 Georgia Public Library Service
367 * Mike Rylander <mrylander@gmail.com>
371 * The available copy statuses, and whether a copy in that
372 * status is available for hold request capture. 0 (zero) is
373 * the only special number in this set, meaning that the item
374 * is available for imediate checkout, and is counted as available
377 * Statuses with an ID below 100 are not removable, and have special
378 * meaning in the code. Do not change them except to translate the
381 * You may add and remove statuses above 100, and these can be used
382 * to remove items from normal circulation without affecting the rest
383 * of the copy's values or it's location.
387 * This program is free software; you can redistribute it and/or
388 * modify it under the terms of the GNU General Public License
389 * as published by the Free Software Foundation; either version 2
390 * of the License, or (at your option) any later version.
392 * This program is distributed in the hope that it will be useful,
393 * but WITHOUT ANY WARRANTY; without even the implied warranty of
394 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
395 * GNU General Public License for more details.
399 INSERT INTO config.copy_status (id,name,holdable) VALUES (0,'Available','t');
400 INSERT INTO config.copy_status (name,holdable) VALUES ('Checked out','t');
401 INSERT INTO config.copy_status (name) VALUES ('Bindery');
402 INSERT INTO config.copy_status (name) VALUES ('Lost');
403 INSERT INTO config.copy_status (name) VALUES ('Missing');
404 INSERT INTO config.copy_status (name,holdable) VALUES ('In process','t');
405 INSERT INTO config.copy_status (name,holdable) VALUES ('In transit','t');
406 INSERT INTO config.copy_status (name,holdable) VALUES ('Reshelving','t');
407 INSERT INTO config.copy_status (name) VALUES ('On holds shelf');
408 INSERT INTO config.copy_status (name,holdable) VALUES ('On order','t');
409 INSERT INTO config.copy_status (name) VALUES ('ILL');
410 INSERT INTO config.copy_status (name) VALUES ('Cataloging');
411 INSERT INTO config.copy_status (name) VALUES ('Reserves');
412 INSERT INTO config.copy_status (name) VALUES ('Discard/Weed');
414 SELECT SETVAL('config.copy_status_id_seq'::TEXT, 100);
417 CREATE TABLE config.net_access_level (
418 id SERIAL PRIMARY KEY,
419 name TEXT NOT NULL UNIQUE
421 COMMENT ON TABLE config.net_access_level IS $$
423 * Copyright (C) 2005 Georgia Public Library Service
424 * Mike Rylander <mrylander@gmail.com>
426 * Patron Network Access level
428 * This will be used to inform the in-library firewall of how much
429 * internet access the using patron should be allowed.
433 * This program is free software; you can redistribute it and/or
434 * modify it under the terms of the GNU General Public License
435 * as published by the Free Software Foundation; either version 2
436 * of the License, or (at your option) any later version.
438 * This program is distributed in the hope that it will be useful,
439 * but WITHOUT ANY WARRANTY; without even the implied warranty of
440 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
441 * GNU General Public License for more details.
445 INSERT INTO config.net_access_level (name) VALUES ('Restricted');
446 INSERT INTO config.net_access_level (name) VALUES ('Full');
447 INSERT INTO config.net_access_level (name) VALUES ('None');
449 CREATE TABLE config.language_map (
450 code TEXT PRIMARY KEY,
454 COPY config.language_map FROM STDIN;
461 afa Afroasiatic (Other)
462 afh Afrihili (Artificial language)
469 alg Algonquian (Other)
471 ang English, Old (ca. 450-1100)
475 arg Aragonese Spanish
479 art Artificial (Other)
483 ath Athapascan (Other)
484 aus Australian languages
491 bai Bamileke languages
520 cai Central American Indian (Other)
524 cau Caucasian (Other)
545 cpe Creoles and Pidgins, English-based (Other)
546 cpf Creoles and Pidgins, French-based (Other)
547 cpp Creoles and Pidgins, Portuguese-based (Other)
550 crp Creoles and Pidgins (Other)
563 dra Dravidian (Other)
565 dum Dutch, Middle (ca. 1050-1350)
574 enm English, Middle (1100-1500)
576 -esk Eskimo languages
588 fiu Finno-Ugrian (Other)
592 frm French, Middle (ca. 1400-1600)
593 fro French, Old (ca. 842-1400)
612 gmh German, Middle High (ca. 1050-1500)
613 goh German, Old High (ca. 750-1050)
618 grc Greek, Ancient (to 1453)
619 gre Greek, Modern (1453- )
625 hat Haitian French Creole
647 ina Interlingua (International Auxiliary Language Association)
650 ine Indo-European (Other)
652 -int Interlingua (International Auxiliary Language Association)
656 iro Iroquoian (Other)
698 -lan Occitan (post-1500)
715 luo Luo (Kenya and Tanzania)
726 map Austronesian (Other)
733 mga Irish, Middle (ca. 1100-1550)
736 mis Miscellaneous languages
737 mkh Mon-Khmer (Other)
748 mul Multiple languages
754 nai North American Indian (Other)
755 nap Neapolitan Italian
758 nbl Ndebele (South Africa)
759 nde Ndebele (Zimbabwe)
765 nic Niger-Kordofanian (Other)
767 nno Norwegian (Nynorsk)
768 nob Norwegian (Bokmål)
779 oci Occitan (post-1500)
786 oto Otomian languages
794 peo Old Persian (ca. 600-400 B.C.)
796 phi Philippine (Other)
802 pra Prakrit languages
803 pro Provençal (to 1500)
816 sag Sango (Ubangi Creole)
818 sai South American Indian (Other)
819 sal Salishan languages
820 sam Samaritan Aramaic
830 sga Irish, Old (to 1100)
837 sit Sino-Tibetan (Other)
859 ssa Nilo-Saharan (Other)
920 wak Wakashan languages
925 wen Sorbian languages
943 CREATE TABLE config.item_form_map (
944 code TEXT PRIMARY KEY,
948 COPY config.item_form_map FROM STDIN;
954 r Regular print reproduction
958 CREATE TABLE config.item_type_map (
959 code TEXT PRIMARY KEY,
963 COPY config.item_type_map FROM STDIN;
965 t Manuscript language material
967 k Two-dimensional nonprojectable graphic
968 r Three-dimensional artifact or naturally occurring object
971 e Cartographic material
972 f Manuscript cartographic material
974 d Manuscript notated music
975 i Nonmusical sound recording
976 j Musical sound recording