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.
31 CREATE TABLE config.i18n_core (
32 id BIGSERIAL PRIMARY KEY,
33 fq_field TEXT NOT NULL,
34 identity_value TEXT NOT NULL,
35 translation TEXT NOT NULL,
39 CREATE UNIQUE INDEX i18n_identity ON config.i18n_core (fq_field,identity_value,translation);
41 CREATE TABLE config.bib_source (
42 id SERIAL PRIMARY KEY,
43 quality INT CHECK ( quality BETWEEN 0 AND 100 ),
44 source TEXT NOT NULL UNIQUE,
45 transcendant BOOL NOT NULL DEFAULT FALSE
47 COMMENT ON TABLE config.bib_source IS $$
49 * Copyright (C) 2005 Georgia Public Library Service
50 * Mike Rylander <mrylander@gmail.com>
52 * Valid sources of MARC records
54 * This is table is used to set up the relative "quality" of each
55 * MARC source, such as OCLC.
59 * This program is free software; you can redistribute it and/or
60 * modify it under the terms of the GNU General Public License
61 * as published by the Free Software Foundation; either version 2
62 * of the License, or (at your option) any later version.
64 * This program is distributed in the hope that it will be useful,
65 * but WITHOUT ANY WARRANTY; without even the implied warranty of
66 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67 * GNU General Public License for more details.
71 CREATE TABLE config.standing (
72 id SERIAL PRIMARY KEY,
73 value TEXT NOT NULL UNIQUE
75 COMMENT ON TABLE config.standing IS $$
77 * Copyright (C) 2005 Georgia Public Library Service
78 * Mike Rylander <mrylander@gmail.com>
82 * This table contains the values that can be applied to a patron
83 * by a staff member. These values should not be changed, other
84 * than for translation, as the ID column is currently a "magic
85 * number" in the source. :(
89 * This program is free software; you can redistribute it and/or
90 * modify it under the terms of the GNU General Public License
91 * as published by the Free Software Foundation; either version 2
92 * of the License, or (at your option) any later version.
94 * This program is distributed in the hope that it will be useful,
95 * but WITHOUT ANY WARRANTY; without even the implied warranty of
96 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
97 * GNU General Public License for more details.
101 CREATE TABLE config.xml_transform (
102 name TEXT PRIMARY KEY,
103 namespace_uri TEXT NOT NULL UNIQUE,
104 prefix TEXT NOT NULL,
108 CREATE TABLE config.metabib_field (
109 id SERIAL PRIMARY KEY,
110 field_class TEXT NOT NULL CHECK (lower(field_class) IN ('title','author','subject','keyword','series')),
113 weight INT NOT NULL DEFAULT 1,
114 format TEXT NOT NULL DEFAULT 'mods',
115 search_field BOOL NOT NULL DEFAULT TRUE,
116 facet_field BOOL NOT NULL DEFAULT FALSE
118 COMMENT ON TABLE config.metabib_field IS $$
120 * Copyright (C) 2005 Georgia Public Library Service
121 * Mike Rylander <mrylander@gmail.com>
123 * XPath used for record indexing ingest
125 * This table contains the XPath used to chop up MODS into its
126 * indexable parts. Each XPath entry is named and assigned to
127 * a "class" of either title, subject, author, keyword or series.
132 * This program is free software; you can redistribute it and/or
133 * modify it under the terms of the GNU General Public License
134 * as published by the Free Software Foundation; either version 2
135 * of the License, or (at your option) any later version.
137 * This program is distributed in the hope that it will be useful,
138 * but WITHOUT ANY WARRANTY; without even the implied warranty of
139 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
140 * GNU General Public License for more details.
144 CREATE UNIQUE INDEX config_metabib_field_class_name_idx ON config.metabib_field (field_class, name);
146 CREATE TABLE config.non_cataloged_type (
147 id SERIAL PRIMARY KEY,
148 owning_lib INT NOT NULL, -- REFERENCES actor.org_unit (id),
150 circ_duration INTERVAL NOT NULL DEFAULT '14 days'::INTERVAL,
151 in_house BOOL NOT NULL DEFAULT FALSE,
152 CONSTRAINT noncat_once_per_lib UNIQUE (owning_lib,name)
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.
176 CREATE TABLE config.identification_type (
177 id SERIAL PRIMARY KEY,
178 name TEXT NOT NULL UNIQUE
180 COMMENT ON TABLE config.identification_type IS $$
182 * Copyright (C) 2005 Georgia Public Library Service
183 * Mike Rylander <mrylander@gmail.com>
185 * Types of valid patron identification.
187 * Each patron must display at least one valid form of identification
188 * in order to get a library card. This table lists those forms.
193 * This program is free software; you can redistribute it and/or
194 * modify it under the terms of the GNU General Public License
195 * as published by the Free Software Foundation; either version 2
196 * of the License, or (at your option) any later version.
198 * This program is distributed in the hope that it will be useful,
199 * but WITHOUT ANY WARRANTY; without even the implied warranty of
200 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
201 * GNU General Public License for more details.
205 CREATE TABLE config.rule_circ_duration (
206 id SERIAL PRIMARY KEY,
207 name TEXT NOT NULL UNIQUE CHECK ( name ~ E'^\\w+$' ),
208 extended INTERVAL NOT NULL,
209 normal INTERVAL NOT NULL,
210 shrt INTERVAL NOT NULL,
211 max_renewals INT NOT NULL
213 COMMENT ON TABLE config.rule_circ_duration IS $$
215 * Copyright (C) 2005 Georgia Public Library Service
216 * Mike Rylander <mrylander@gmail.com>
218 * Circulation Duration rules
220 * Each circulation is given a duration based on one of these rules.
225 * This program is free software; you can redistribute it and/or
226 * modify it under the terms of the GNU General Public License
227 * as published by the Free Software Foundation; either version 2
228 * of the License, or (at your option) any later version.
230 * This program is distributed in the hope that it will be useful,
231 * but WITHOUT ANY WARRANTY; without even the implied warranty of
232 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
233 * GNU General Public License for more details.
237 CREATE TABLE config.rule_max_fine (
238 id SERIAL PRIMARY KEY,
239 name TEXT NOT NULL UNIQUE CHECK ( name ~ E'^\\w+$' ),
240 amount NUMERIC(6,2) NOT NULL
242 COMMENT ON TABLE config.rule_max_fine IS $$
244 * Copyright (C) 2005 Georgia Public Library Service
245 * Mike Rylander <mrylander@gmail.com>
247 * Circulation Max Fine rules
249 * Each circulation is given a maximum fine based on one of
255 * This program is free software; you can redistribute it and/or
256 * modify it under the terms of the GNU General Public License
257 * as published by the Free Software Foundation; either version 2
258 * of the License, or (at your option) any later version.
260 * This program is distributed in the hope that it will be useful,
261 * but WITHOUT ANY WARRANTY; without even the implied warranty of
262 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
263 * GNU General Public License for more details.
267 CREATE TABLE config.rule_recuring_fine (
268 id SERIAL PRIMARY KEY,
269 name TEXT NOT NULL UNIQUE CHECK ( name ~ E'^\\w+$' ),
270 high NUMERIC(6,2) NOT NULL,
271 normal NUMERIC(6,2) NOT NULL,
272 low NUMERIC(6,2) NOT NULL,
273 recurance_interval INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL
275 COMMENT ON TABLE config.rule_recuring_fine IS $$
277 * Copyright (C) 2005 Georgia Public Library Service
278 * Mike Rylander <mrylander@gmail.com>
280 * Circulation Recurring Fine rules
282 * Each circulation is given a recurring fine amount based on one of
283 * these rules. The recurance_interval should not be any shorter
284 * than the interval between runs of the fine_processor.pl script
285 * (which is run from CRON), or you could miss fines.
290 * This program is free software; you can redistribute it and/or
291 * modify it under the terms of the GNU General Public License
292 * as published by the Free Software Foundation; either version 2
293 * of the License, or (at your option) any later version.
295 * This program is distributed in the hope that it will be useful,
296 * but WITHOUT ANY WARRANTY; without even the implied warranty of
297 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
298 * GNU General Public License for more details.
303 CREATE TABLE config.rule_age_hold_protect (
304 id SERIAL PRIMARY KEY,
305 name TEXT NOT NULL UNIQUE CHECK ( name ~ E'^\\w+$' ),
306 age INTERVAL NOT NULL,
309 COMMENT ON TABLE config.rule_age_hold_protect IS $$
311 * Copyright (C) 2005 Georgia Public Library Service
312 * Mike Rylander <mrylander@gmail.com>
314 * Hold Item Age Protection rules
316 * A hold request can only capture new(ish) items when they are
317 * within a particular proximity of the home_ou of the requesting
318 * user. The proximity ('prox' column) is calculated by counting
319 * the number of tree edges between the user's home_ou and the owning_lib
320 * of the copy that could fulfill the hold.
325 * This program is free software; you can redistribute it and/or
326 * modify it under the terms of the GNU General Public License
327 * as published by the Free Software Foundation; either version 2
328 * of the License, or (at your option) any later version.
330 * This program is distributed in the hope that it will be useful,
331 * but WITHOUT ANY WARRANTY; without even the implied warranty of
332 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
333 * GNU General Public License for more details.
337 CREATE TABLE config.copy_status (
338 id SERIAL PRIMARY KEY,
339 name TEXT NOT NULL UNIQUE,
340 holdable BOOL NOT NULL DEFAULT FALSE
342 COMMENT ON TABLE config.copy_status IS $$
344 * Copyright (C) 2005 Georgia Public Library Service
345 * Mike Rylander <mrylander@gmail.com>
349 * The available copy statuses, and whether a copy in that
350 * status is available for hold request capture. 0 (zero) is
351 * the only special number in this set, meaning that the item
352 * is available for immediate checkout, and is counted as available
355 * Statuses with an ID below 100 are not removable, and have special
356 * meaning in the code. Do not change them except to translate the
359 * You may add and remove statuses above 100, and these can be used
360 * to remove items from normal circulation without affecting the rest
361 * of the copy's values or its location.
365 * This program is free software; you can redistribute it and/or
366 * modify it under the terms of the GNU General Public License
367 * as published by the Free Software Foundation; either version 2
368 * of the License, or (at your option) any later version.
370 * This program is distributed in the hope that it will be useful,
371 * but WITHOUT ANY WARRANTY; without even the implied warranty of
372 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
373 * GNU General Public License for more details.
377 CREATE TABLE config.net_access_level (
378 id SERIAL PRIMARY KEY,
379 name TEXT NOT NULL UNIQUE
381 COMMENT ON TABLE config.net_access_level IS $$
383 * Copyright (C) 2005 Georgia Public Library Service
384 * Mike Rylander <mrylander@gmail.com>
386 * Patron Network Access level
388 * This will be used to inform the in-library firewall of how much
389 * internet access the using patron should be allowed.
393 * This program is free software; you can redistribute it and/or
394 * modify it under the terms of the GNU General Public License
395 * as published by the Free Software Foundation; either version 2
396 * of the License, or (at your option) any later version.
398 * This program is distributed in the hope that it will be useful,
399 * but WITHOUT ANY WARRANTY; without even the implied warranty of
400 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
401 * GNU General Public License for more details.
405 CREATE TABLE config.audience_map (
406 code TEXT PRIMARY KEY,
411 CREATE TABLE config.lit_form_map (
412 code TEXT PRIMARY KEY,
417 CREATE TABLE config.language_map (
418 code TEXT PRIMARY KEY,
422 CREATE TABLE config.item_form_map (
423 code TEXT PRIMARY KEY,
427 CREATE TABLE config.item_type_map (
428 code TEXT PRIMARY KEY,