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.identification_type (
150 id SERIAL PRIMARY KEY,
151 name TEXT NOT NULL UNIQUE
153 COMMENT ON TABLE config.identification_type IS $$
155 * Copyright (C) 2005 Georgia Public Library Service
156 * Mike Rylander <mrylander@gmail.com>
158 * Types of valid patron identification.
160 * Each patron must display at least one valid form of identification
161 * in order to get a library card. This table lists those forms.
166 * This program is free software; you can redistribute it and/or
167 * modify it under the terms of the GNU General Public License
168 * as published by the Free Software Foundation; either version 2
169 * of the License, or (at your option) any later version.
171 * This program is distributed in the hope that it will be useful,
172 * but WITHOUT ANY WARRANTY; without even the implied warranty of
173 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
174 * GNU General Public License for more details.
179 INSERT INTO config.identification_type ( name ) VALUES ( 'Drivers Licence' );
180 INSERT INTO config.identification_type ( name ) VALUES ( 'Voter Card' );
181 INSERT INTO config.identification_type ( name ) VALUES ( 'Two Utility Bills' );
182 INSERT INTO config.identification_type ( name ) VALUES ( 'State ID' );
183 INSERT INTO config.identification_type ( name ) VALUES ( 'SSN' );
185 CREATE TABLE config.rule_circ_duration (
186 id SERIAL PRIMARY KEY,
187 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
188 extended INTERVAL NOT NULL,
189 normal INTERVAL NOT NULL,
190 shrt INTERVAL NOT NULL,
191 max_renewals INT NOT NULL
193 COMMENT ON TABLE config.rule_circ_duration IS $$
195 * Copyright (C) 2005 Georgia Public Library Service
196 * Mike Rylander <mrylander@gmail.com>
198 * Circulation Duration rules
200 * Each circulation is given a duration based on one of these rules.
205 * This program is free software; you can redistribute it and/or
206 * modify it under the terms of the GNU General Public License
207 * as published by the Free Software Foundation; either version 2
208 * of the License, or (at your option) any later version.
210 * This program is distributed in the hope that it will be useful,
211 * but WITHOUT ANY WARRANTY; without even the implied warranty of
212 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
213 * GNU General Public License for more details.
217 INSERT INTO config.rule_circ_duration VALUES (DEFAULT, '2wk_default', '21 days', '14 days', '7 days', 2);
220 CREATE TABLE config.rule_max_fine (
221 id SERIAL PRIMARY KEY,
222 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
223 amount NUMERIC(6,2) NOT NULL
225 COMMENT ON TABLE config.rule_max_fine IS $$
227 * Copyright (C) 2005 Georgia Public Library Service
228 * Mike Rylander <mrylander@gmail.com>
230 * Circulation Max Fine rules
232 * Each circulation is given a maximum fine based on one of
238 * This program is free software; you can redistribute it and/or
239 * modify it under the terms of the GNU General Public License
240 * as published by the Free Software Foundation; either version 2
241 * of the License, or (at your option) any later version.
243 * This program is distributed in the hope that it will be useful,
244 * but WITHOUT ANY WARRANTY; without even the implied warranty of
245 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
246 * GNU General Public License for more details.
250 INSERT INTO config.rule_max_fine VALUES (DEFAULT, 'books', 50.00);
253 CREATE TABLE config.rule_recuring_fine (
254 id SERIAL PRIMARY KEY,
255 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
256 high NUMERIC(6,2) NOT NULL,
257 normal NUMERIC(6,2) NOT NULL,
258 low NUMERIC(6,2) NOT NULL,
259 recurance_interval INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL
261 COMMENT ON TABLE config.rule_recuring_fine IS $$
263 * Copyright (C) 2005 Georgia Public Library Service
264 * Mike Rylander <mrylander@gmail.com>
266 * Circulation Recuring Fine rules
268 * Each circulation is given a recuring fine amount based on one of
269 * these rules. The recurance_interval should not be any shorter
270 * than the interval between runs of the fine_processor.pl script
271 * (which is run from CRON), or you could miss fines.
276 * This program is free software; you can redistribute it and/or
277 * modify it under the terms of the GNU General Public License
278 * as published by the Free Software Foundation; either version 2
279 * of the License, or (at your option) any later version.
281 * This program is distributed in the hope that it will be useful,
282 * but WITHOUT ANY WARRANTY; without even the implied warranty of
283 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
284 * GNU General Public License for more details.
288 INSERT INTO config.rule_recuring_fine VALUES (1, 'books', 0.50, 0.10, 0.10, '1 day');
291 CREATE TABLE config.rule_age_hold_protect (
292 id SERIAL PRIMARY KEY,
293 name TEXT NOT NULL UNIQUE CHECK ( name ~ '^\\w+$' ),
294 age INTERVAL NOT NULL,
297 COMMENT ON TABLE config.rule_age_hold_protect IS $$
299 * Copyright (C) 2005 Georgia Public Library Service
300 * Mike Rylander <mrylander@gmail.com>
302 * Hold Item Age Protection rules
304 * A hold request can only capture new(ish) items when they are
305 * within a particular proximity of the home_ou of the requesting
306 * user. The proximity ('prox' column) is calculated by counting
307 * the number of tree edges beween the user's home_ou and the owning_lib
308 * of the copy that could fulfill the hold.
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_age_hold_protect VALUES (DEFAULT, '3month', '3 mons', 0);
326 INSERT INTO config.rule_age_hold_protect VALUES (DEFAULT, '6month', '6 mons', 2);
329 CREATE TABLE config.copy_status (
330 id SERIAL PRIMARY KEY,
331 name TEXT NOT NULL UNIQUE,
332 holdable BOOL NOT NULL DEFAULT FALSE
334 COMMENT ON TABLE config.copy_status IS $$
336 * Copyright (C) 2005 Georgia Public Library Service
337 * Mike Rylander <mrylander@gmail.com>
341 * The available copy statuses, and whether a copy in that
342 * status is available for hold request capture. 0 (zero) is
343 * the only special number in this set, meaning that the item
344 * is available for imediate checkout, and is counted as available
347 * Statuses with an ID below 100 are not removable, and have special
348 * meaning in the code. Do not change them except to translate the
351 * You may add and remove statuses above 100, and these can be used
352 * to remove items from normal circulation without affecting the rest
353 * of the copy's values or it's location.
357 * This program is free software; you can redistribute it and/or
358 * modify it under the terms of the GNU General Public License
359 * as published by the Free Software Foundation; either version 2
360 * of the License, or (at your option) any later version.
362 * This program is distributed in the hope that it will be useful,
363 * but WITHOUT ANY WARRANTY; without even the implied warranty of
364 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
365 * GNU General Public License for more details.
369 INSERT INTO config.copy_status (id,name,holdable) VALUES (0,'Available','t');
370 INSERT INTO config.copy_status (name,holdable) VALUES ('Checked out','t');
371 INSERT INTO config.copy_status (name) VALUES ('Bindery');
372 INSERT INTO config.copy_status (name) VALUES ('Lost');
373 INSERT INTO config.copy_status (name) VALUES ('Missing');
374 INSERT INTO config.copy_status (name,holdable) VALUES ('In process','t');
375 INSERT INTO config.copy_status (name,holdable) VALUES ('In transit','t');
376 INSERT INTO config.copy_status (name,holdable) VALUES ('Reshelving','t');
377 INSERT INTO config.copy_status (name) VALUES ('On holds shelf');
378 INSERT INTO config.copy_status (name,holdable) VALUES ('On order','t');
379 INSERT INTO config.copy_status (name) VALUES ('ILL');
380 INSERT INTO config.copy_status (name) VALUES ('Cataloging');
381 INSERT INTO config.copy_status (name) VALUES ('Reserves');
382 INSERT INTO config.copy_status (name) VALUES ('Discard/Weed');
384 SELECT SETVAL('config.copy_status_id_seq'::TEXT, 100);
387 CREATE TABLE config.net_access_level (
388 id SERIAL PRIMARY KEY,
389 name TEXT NOT NULL UNIQUE
391 COMMENT ON TABLE config.net_access_level IS $$
393 * Copyright (C) 2005 Georgia Public Library Service
394 * Mike Rylander <mrylander@gmail.com>
396 * Patron Network Access level
398 * This will be used to inform the in-library firewall of how much
399 * internet access the using patron should be allowed.
403 * This program is free software; you can redistribute it and/or
404 * modify it under the terms of the GNU General Public License
405 * as published by the Free Software Foundation; either version 2
406 * of the License, or (at your option) any later version.
408 * This program is distributed in the hope that it will be useful,
409 * but WITHOUT ANY WARRANTY; without even the implied warranty of
410 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
411 * GNU General Public License for more details.
415 INSERT INTO config.net_access_level (name) VALUES ('Restricted');
416 INSERT INTO config.net_access_level (name) VALUES ('Full');
417 INSERT INTO config.net_access_level (name) VALUES ('None');
419 CREATE TABLE config.language_map (
420 code TEXT PRIMARY KEY,
424 COPY config.language_map FROM STDIN;
431 afa Afroasiatic (Other)
432 afh Afrihili (Artificial language)
439 alg Algonquian (Other)
441 ang English, Old (ca. 450-1100)
445 arg Aragonese Spanish
449 art Artificial (Other)
453 ath Athapascan (Other)
454 aus Australian languages
461 bai Bamileke languages
490 cai Central American Indian (Other)
494 cau Caucasian (Other)
515 cpe Creoles and Pidgins, English-based (Other)
516 cpf Creoles and Pidgins, French-based (Other)
517 cpp Creoles and Pidgins, Portuguese-based (Other)
520 crp Creoles and Pidgins (Other)
533 dra Dravidian (Other)
535 dum Dutch, Middle (ca. 1050-1350)
544 enm English, Middle (1100-1500)
546 -esk Eskimo languages
558 fiu Finno-Ugrian (Other)
562 frm French, Middle (ca. 1400-1600)
563 fro French, Old (ca. 842-1400)
582 gmh German, Middle High (ca. 1050-1500)
583 goh German, Old High (ca. 750-1050)
588 grc Greek, Ancient (to 1453)
589 gre Greek, Modern (1453- )
595 hat Haitian French Creole
617 ina Interlingua (International Auxiliary Language Association)
620 ine Indo-European (Other)
622 -int Interlingua (International Auxiliary Language Association)
626 iro Iroquoian (Other)
668 -lan Occitan (post-1500)
685 luo Luo (Kenya and Tanzania)
696 map Austronesian (Other)
703 mga Irish, Middle (ca. 1100-1550)
706 mis Miscellaneous languages
707 mkh Mon-Khmer (Other)
718 mul Multiple languages
724 nai North American Indian (Other)
725 nap Neapolitan Italian
728 nbl Ndebele (South Africa)
729 nde Ndebele (Zimbabwe)
735 nic Niger-Kordofanian (Other)
737 nno Norwegian (Nynorsk)
738 nob Norwegian (Bokmål)
749 oci Occitan (post-1500)
756 oto Otomian languages
764 peo Old Persian (ca. 600-400 B.C.)
766 phi Philippine (Other)
772 pra Prakrit languages
773 pro Provençal (to 1500)
786 sag Sango (Ubangi Creole)
788 sai South American Indian (Other)
789 sal Salishan languages
790 sam Samaritan Aramaic
800 sga Irish, Old (to 1100)
807 sit Sino-Tibetan (Other)
829 ssa Nilo-Saharan (Other)
890 wak Wakashan languages
895 wen Sorbian languages