2 * Copyright (C) 2004-2008 Georgia Public Library Service
3 * Copyright (C) 2008 Equinox Software, Inc.
4 * Mike Rylander <miker@esilibrary.com>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
20 DROP SCHEMA stats CASCADE;
21 DROP SCHEMA config CASCADE;
27 COMMENT ON SCHEMA config IS $$
29 * Copyright (C) 2005 Georgia Public Library Service
30 * Mike Rylander <mrylander@gmail.com>
32 * The config schema holds static configuration data for the
33 * Open-ILS installation.
37 * This program is free software; you can redistribute it and/or
38 * modify it under the terms of the GNU General Public License
39 * as published by the Free Software Foundation; either version 2
40 * of the License, or (at your option) any later version.
42 * This program is distributed in the hope that it will be useful,
43 * but WITHOUT ANY WARRANTY; without even the implied warranty of
44 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45 * GNU General Public License for more details.
49 CREATE TABLE config.i18n_core (
50 id BIGSERIAL PRIMARY KEY,
51 fq_field TEXT NOT NULL,
52 identity_value TEXT NOT NULL,
53 translation TEXT NOT NULL,
57 CREATE UNIQUE INDEX i18n_identity ON config.i18n_core (fq_field,identity_value,translation);
59 CREATE TABLE config.bib_source (
60 id SERIAL PRIMARY KEY,
61 quality INT CHECK ( quality BETWEEN 0 AND 100 ),
62 source TEXT NOT NULL UNIQUE,
63 transcendant BOOL NOT NULL DEFAULT FALSE
65 COMMENT ON TABLE config.bib_source IS $$
67 * Copyright (C) 2005 Georgia Public Library Service
68 * Mike Rylander <mrylander@gmail.com>
70 * Valid sources of MARC records
72 * This is table is used to set up the relative "quality" of each
73 * MARC source, such as OCLC.
77 * This program is free software; you can redistribute it and/or
78 * modify it under the terms of the GNU General Public License
79 * as published by the Free Software Foundation; either version 2
80 * of the License, or (at your option) any later version.
82 * This program is distributed in the hope that it will be useful,
83 * but WITHOUT ANY WARRANTY; without even the implied warranty of
84 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
85 * GNU General Public License for more details.
89 CREATE TABLE config.standing (
90 id SERIAL PRIMARY KEY,
91 value TEXT NOT NULL UNIQUE
93 COMMENT ON TABLE config.standing IS $$
95 * Copyright (C) 2005 Georgia Public Library Service
96 * Mike Rylander <mrylander@gmail.com>
100 * This table contains the values that can be applied to a patron
101 * by a staff member. These values should not be changed, other
102 * than for translation, as the ID column is currently a "magic
103 * number" in the source. :(
107 * This program is free software; you can redistribute it and/or
108 * modify it under the terms of the GNU General Public License
109 * as published by the Free Software Foundation; either version 2
110 * of the License, or (at your option) any later version.
112 * This program is distributed in the hope that it will be useful,
113 * but WITHOUT ANY WARRANTY; without even the implied warranty of
114 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
115 * GNU General Public License for more details.
119 CREATE TABLE config.xml_transform (
120 name TEXT PRIMARY KEY,
121 namespace_uri TEXT NOT NULL,
122 prefix TEXT NOT NULL,
126 CREATE TABLE config.metabib_field (
127 id SERIAL PRIMARY KEY,
128 field_class TEXT NOT NULL CHECK (lower(field_class) IN ('title','author','subject','keyword','series')),
131 weight INT NOT NULL DEFAULT 1,
132 format TEXT NOT NULL DEFAULT 'mods',
133 search_field BOOL NOT NULL DEFAULT TRUE,
134 facet_field BOOL NOT NULL DEFAULT FALSE
136 COMMENT ON TABLE config.metabib_field IS $$
138 * Copyright (C) 2005 Georgia Public Library Service
139 * Mike Rylander <mrylander@gmail.com>
141 * XPath used for record indexing ingest
143 * This table contains the XPath used to chop up MODS into its
144 * indexable parts. Each XPath entry is named and assigned to
145 * a "class" of either title, subject, author, keyword or series.
150 * This program is free software; you can redistribute it and/or
151 * modify it under the terms of the GNU General Public License
152 * as published by the Free Software Foundation; either version 2
153 * of the License, or (at your option) any later version.
155 * This program is distributed in the hope that it will be useful,
156 * but WITHOUT ANY WARRANTY; without even the implied warranty of
157 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
158 * GNU General Public License for more details.
162 CREATE UNIQUE INDEX config_metabib_field_class_name_idx ON config.metabib_field (field_class, name);
164 CREATE TABLE config.non_cataloged_type (
165 id SERIAL PRIMARY KEY,
166 owning_lib INT NOT NULL, -- REFERENCES actor.org_unit (id),
168 circ_duration INTERVAL NOT NULL DEFAULT '14 days'::INTERVAL,
169 in_house BOOL NOT NULL DEFAULT FALSE,
170 CONSTRAINT noncat_once_per_lib UNIQUE (owning_lib,name)
172 COMMENT ON TABLE config.non_cataloged_type IS $$
174 * Copyright (C) 2005 Georgia Public Library Service
175 * Mike Rylander <mrylander@gmail.com>
177 * Types of valid non-cataloged items.
182 * This program is free software; you can redistribute it and/or
183 * modify it under the terms of the GNU General Public License
184 * as published by the Free Software Foundation; either version 2
185 * of the License, or (at your option) any later version.
187 * This program is distributed in the hope that it will be useful,
188 * but WITHOUT ANY WARRANTY; without even the implied warranty of
189 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
190 * GNU General Public License for more details.
194 CREATE TABLE config.identification_type (
195 id SERIAL PRIMARY KEY,
196 name TEXT NOT NULL UNIQUE
198 COMMENT ON TABLE config.identification_type IS $$
200 * Copyright (C) 2005 Georgia Public Library Service
201 * Mike Rylander <mrylander@gmail.com>
203 * Types of valid patron identification.
205 * Each patron must display at least one valid form of identification
206 * in order to get a library card. This table lists those forms.
211 * This program is free software; you can redistribute it and/or
212 * modify it under the terms of the GNU General Public License
213 * as published by the Free Software Foundation; either version 2
214 * of the License, or (at your option) any later version.
216 * This program is distributed in the hope that it will be useful,
217 * but WITHOUT ANY WARRANTY; without even the implied warranty of
218 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
219 * GNU General Public License for more details.
223 CREATE TABLE config.rule_circ_duration (
224 id SERIAL PRIMARY KEY,
225 name TEXT NOT NULL UNIQUE CHECK ( name ~ E'^\\w+$' ),
226 extended INTERVAL NOT NULL,
227 normal INTERVAL NOT NULL,
228 shrt INTERVAL NOT NULL,
229 max_renewals INT NOT NULL
231 COMMENT ON TABLE config.rule_circ_duration IS $$
233 * Copyright (C) 2005 Georgia Public Library Service
234 * Mike Rylander <mrylander@gmail.com>
236 * Circulation Duration rules
238 * Each circulation is given a duration based on one of these rules.
243 * This program is free software; you can redistribute it and/or
244 * modify it under the terms of the GNU General Public License
245 * as published by the Free Software Foundation; either version 2
246 * of the License, or (at your option) any later version.
248 * This program is distributed in the hope that it will be useful,
249 * but WITHOUT ANY WARRANTY; without even the implied warranty of
250 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
251 * GNU General Public License for more details.
255 CREATE TABLE config.rule_max_fine (
256 id SERIAL PRIMARY KEY,
257 name TEXT NOT NULL UNIQUE CHECK ( name ~ E'^\\w+$' ),
258 amount NUMERIC(6,2) NOT NULL
260 COMMENT ON TABLE config.rule_max_fine IS $$
262 * Copyright (C) 2005 Georgia Public Library Service
263 * Mike Rylander <mrylander@gmail.com>
265 * Circulation Max Fine rules
267 * Each circulation is given a maximum fine based on one of
273 * This program is free software; you can redistribute it and/or
274 * modify it under the terms of the GNU General Public License
275 * as published by the Free Software Foundation; either version 2
276 * of the License, or (at your option) any later version.
278 * This program is distributed in the hope that it will be useful,
279 * but WITHOUT ANY WARRANTY; without even the implied warranty of
280 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
281 * GNU General Public License for more details.
285 CREATE TABLE config.rule_recuring_fine (
286 id SERIAL PRIMARY KEY,
287 name TEXT NOT NULL UNIQUE CHECK ( name ~ E'^\\w+$' ),
288 high NUMERIC(6,2) NOT NULL,
289 normal NUMERIC(6,2) NOT NULL,
290 low NUMERIC(6,2) NOT NULL,
291 recurance_interval INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL
293 COMMENT ON TABLE config.rule_recuring_fine IS $$
295 * Copyright (C) 2005 Georgia Public Library Service
296 * Mike Rylander <mrylander@gmail.com>
298 * Circulation Recurring Fine rules
300 * Each circulation is given a recurring fine amount based on one of
301 * these rules. The recurance_interval should not be any shorter
302 * than the interval between runs of the fine_processor.pl script
303 * (which is run from CRON), or you could miss fines.
308 * This program is free software; you can redistribute it and/or
309 * modify it under the terms of the GNU General Public License
310 * as published by the Free Software Foundation; either version 2
311 * of the License, or (at your option) any later version.
313 * This program is distributed in the hope that it will be useful,
314 * but WITHOUT ANY WARRANTY; without even the implied warranty of
315 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
316 * GNU General Public License for more details.
321 CREATE TABLE config.rule_age_hold_protect (
322 id SERIAL PRIMARY KEY,
323 name TEXT NOT NULL UNIQUE CHECK ( name ~ E'^\\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 between 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 CREATE TABLE config.copy_status (
356 id SERIAL PRIMARY KEY,
357 name TEXT NOT NULL UNIQUE,
358 holdable BOOL NOT NULL DEFAULT FALSE,
359 opac_visible BOOL NOT NULL DEFAULT FALSE
361 COMMENT ON TABLE config.copy_status IS $$
363 * Copyright (C) 2005 Georgia Public Library Service
364 * Mike Rylander <mrylander@gmail.com>
368 * The available copy statuses, and whether a copy in that
369 * status is available for hold request capture. 0 (zero) is
370 * the only special number in this set, meaning that the item
371 * is available for immediate checkout, and is counted as available
374 * Statuses with an ID below 100 are not removable, and have special
375 * meaning in the code. Do not change them except to translate the
378 * You may add and remove statuses above 100, and these can be used
379 * to remove items from normal circulation without affecting the rest
380 * of the copy's values or its location.
384 * This program is free software; you can redistribute it and/or
385 * modify it under the terms of the GNU General Public License
386 * as published by the Free Software Foundation; either version 2
387 * of the License, or (at your option) any later version.
389 * This program is distributed in the hope that it will be useful,
390 * but WITHOUT ANY WARRANTY; without even the implied warranty of
391 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
392 * GNU General Public License for more details.
396 CREATE TABLE config.net_access_level (
397 id SERIAL PRIMARY KEY,
398 name TEXT NOT NULL UNIQUE
400 COMMENT ON TABLE config.net_access_level IS $$
402 * Copyright (C) 2005 Georgia Public Library Service
403 * Mike Rylander <mrylander@gmail.com>
405 * Patron Network Access level
407 * This will be used to inform the in-library firewall of how much
408 * internet access the using patron should be allowed.
412 * This program is free software; you can redistribute it and/or
413 * modify it under the terms of the GNU General Public License
414 * as published by the Free Software Foundation; either version 2
415 * of the License, or (at your option) any later version.
417 * This program is distributed in the hope that it will be useful,
418 * but WITHOUT ANY WARRANTY; without even the implied warranty of
419 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
420 * GNU General Public License for more details.
424 CREATE TABLE config.audience_map (
425 code TEXT PRIMARY KEY,
430 CREATE TABLE config.lit_form_map (
431 code TEXT PRIMARY KEY,
436 CREATE TABLE config.language_map (
437 code TEXT PRIMARY KEY,
441 CREATE TABLE config.item_form_map (
442 code TEXT PRIMARY KEY,
446 CREATE TABLE config.item_type_map (
447 code TEXT PRIMARY KEY,
451 CREATE TABLE config.bib_level_map (
452 code TEXT PRIMARY KEY,