From dd9c927fe1d1179db86c84683051e2a622246a9e Mon Sep 17 00:00:00 2001 From: gmc Date: Mon, 18 Apr 2011 15:41:16 +0000 Subject: [PATCH] minor improvements to database object comments * remove copyright, license verbiage, and C-style comment marking from the comments; these can live in the SQL scripts * updated several copyright headers * minor improvements to documentation of a couple tables Signed-off-by: Galen Charlton git-svn-id: svn://svn.open-ils.org/ILS/trunk@20160 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/002.schema.config.sql | 370 ++++++-------------------- Open-ILS/src/sql/Pg/005.schema.actors.sql | 242 +++-------------- Open-ILS/src/sql/Pg/008.schema.query.sql | 22 +- Open-ILS/src/sql/Pg/020.schema.functions.sql | 16 +- Open-ILS/src/sql/Pg/090.schema.action.sql | 12 +- Open-ILS/src/sql/Pg/200.schema.acq.sql | 106 +++----- Open-ILS/src/sql/Pg/999.functions.global.sql | 44 +-- 7 files changed, 195 insertions(+), 617 deletions(-) diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 4f27a44..9cc69a1 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -1,7 +1,11 @@ /* * Copyright (C) 2004-2008 Georgia Public Library Service - * Copyright (C) 2008 Equinox Software, Inc. + * Copyright (C) 2008-2011 Equinox Software, Inc. * Mike Rylander + * Copyright (C) 2010 Merrimack Valley Library Consortium + * Jason Stephenson + * Copyright (C) 2010 Laurentian University + * Dan Scott * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -25,25 +29,8 @@ CREATE SCHEMA stats; CREATE SCHEMA config; COMMENT ON SCHEMA config IS $$ -/* - * Copyright (C) 2005 Georgia Public Library Service - * Mike Rylander - * - * The config schema holds static configuration data for the - * Open-ILS installation. - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +The config schema holds static configuration data for the +Evergreen installation. $$; CREATE TABLE config.internal_flag ( @@ -79,27 +66,10 @@ CREATE TABLE config.bib_source ( transcendant BOOL NOT NULL DEFAULT FALSE ); COMMENT ON TABLE config.bib_source IS $$ -/* - * Copyright (C) 2005 Georgia Public Library Service - * Mike Rylander - * - * Valid sources of MARC records - * - * This is table is used to set up the relative "quality" of each - * MARC source, such as OCLC. - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +This is table is used to set up the relative "quality" of each +MARC source, such as OCLC. Also identifies "transcendant" sources, +i.e., sources of bib records that should display in the OPAC +even if no copies or located URIs are attached. $$; CREATE TABLE config.standing ( @@ -107,29 +77,12 @@ CREATE TABLE config.standing ( value TEXT NOT NULL UNIQUE ); COMMENT ON TABLE config.standing IS $$ -/* - * Copyright (C) 2005 Georgia Public Library Service - * Mike Rylander - * - * Patron Standings - * - * This table contains the values that can be applied to a patron - * by a staff member. These values should not be changed, other - * than for translation, as the ID column is currently a "magic - * number" in the source. :( - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Patron Standings + +This table contains the values that can be applied to a patron +by a staff member. These values should not be changed, other +than for translation, as the ID column is currently a "magic +number" in the source. :( $$; CREATE TABLE config.standing_penalty ( @@ -218,29 +171,12 @@ CREATE TABLE config.metabib_field ( facet_xpath TEXT ); COMMENT ON TABLE config.metabib_field IS $$ -/* - * Copyright (C) 2005 Georgia Public Library Service - * Mike Rylander - * - * XPath used for record indexing ingest - * - * This table contains the XPath used to chop up MODS into its - * indexable parts. Each XPath entry is named and assigned to - * a "class" of either title, subject, author, keyword or series. - * - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +XPath used for record indexing ingest + +This table contains the XPath used to chop up MODS into its +indexable parts. Each XPath entry is named and assigned to +a "class" of either title, subject, author, keyword, series +or identifier. $$; CREATE UNIQUE INDEX config_metabib_field_class_name_idx ON config.metabib_field (field_class, name); @@ -260,25 +196,7 @@ CREATE TABLE config.non_cataloged_type ( CONSTRAINT noncat_once_per_lib UNIQUE (owning_lib,name) ); COMMENT ON TABLE config.non_cataloged_type IS $$ -/* - * Copyright (C) 2005 Georgia Public Library Service - * Mike Rylander - * - * Types of valid non-cataloged items. - * - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Types of valid non-cataloged items. $$; CREATE TABLE config.identification_type ( @@ -286,28 +204,10 @@ CREATE TABLE config.identification_type ( name TEXT NOT NULL UNIQUE ); COMMENT ON TABLE config.identification_type IS $$ -/* - * Copyright (C) 2005 Georgia Public Library Service - * Mike Rylander - * - * Types of valid patron identification. - * - * Each patron must display at least one valid form of identification - * in order to get a library card. This table lists those forms. - * - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Types of valid patron identification. + +Each patron must display at least one valid form of identification +in order to get a library card. This table lists those forms. $$; CREATE TABLE config.rule_circ_duration ( @@ -319,27 +219,9 @@ CREATE TABLE config.rule_circ_duration ( max_renewals INT NOT NULL ); COMMENT ON TABLE config.rule_circ_duration IS $$ -/* - * Copyright (C) 2005 Georgia Public Library Service - * Mike Rylander - * - * Circulation Duration rules - * - * Each circulation is given a duration based on one of these rules. - * - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Circulation Duration rules + +Each circulation is given a duration based on one of these rules. $$; CREATE TABLE config.hard_due_date ( @@ -390,28 +272,10 @@ CREATE TABLE config.rule_max_fine ( is_percent BOOL NOT NULL DEFAULT FALSE ); COMMENT ON TABLE config.rule_max_fine IS $$ -/* - * Copyright (C) 2005 Georgia Public Library Service - * Mike Rylander - * - * Circulation Max Fine rules - * - * Each circulation is given a maximum fine based on one of - * these rules. - * - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Circulation Max Fine rules + +Each circulation is given a maximum fine based on one of +these rules. $$; CREATE TABLE config.rule_recurring_fine ( @@ -424,30 +288,12 @@ CREATE TABLE config.rule_recurring_fine ( grace_period INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL ); COMMENT ON TABLE config.rule_recurring_fine IS $$ -/* - * Copyright (C) 2005 Georgia Public Library Service - * Mike Rylander - * - * Circulation Recurring Fine rules - * - * Each circulation is given a recurring fine amount based on one of - * these rules. The recurrence_interval should not be any shorter - * than the interval between runs of the fine_processor.pl script - * (which is run from CRON), or you could miss fines. - * - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Circulation Recurring Fine rules + +Each circulation is given a recurring fine amount based on one of +these rules. The recurrence_interval should not be any shorter +than the interval between runs of the fine_processor.pl script +(which is run from CRON), or you could miss fines. $$; @@ -458,31 +304,13 @@ CREATE TABLE config.rule_age_hold_protect ( prox INT NOT NULL ); COMMENT ON TABLE config.rule_age_hold_protect IS $$ -/* - * Copyright (C) 2005 Georgia Public Library Service - * Mike Rylander - * - * Hold Item Age Protection rules - * - * A hold request can only capture new(ish) items when they are - * within a particular proximity of the home_ou of the requesting - * user. The proximity ('prox' column) is calculated by counting - * the number of tree edges between the user's home_ou and the owning_lib - * of the copy that could fulfill the hold. - * - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Hold Item Age Protection rules + +A hold request can only capture new(ish) items when they are +within a particular proximity of the home_ou of the requesting +user. The proximity ('prox' column) is calculated by counting +the number of tree edges between the user's home_ou and the owning_lib +of the copy that could fulfill the hold. $$; CREATE TABLE config.copy_status ( @@ -492,38 +320,21 @@ CREATE TABLE config.copy_status ( opac_visible BOOL NOT NULL DEFAULT FALSE ); COMMENT ON TABLE config.copy_status IS $$ -/* - * Copyright (C) 2005 Georgia Public Library Service - * Mike Rylander - * - * Copy Statuses - * - * The available copy statuses, and whether a copy in that - * status is available for hold request capture. 0 (zero) is - * the only special number in this set, meaning that the item - * is available for immediate checkout, and is counted as available - * in the OPAC. - * - * Statuses with an ID below 100 are not removable, and have special - * meaning in the code. Do not change them except to translate the - * textual name. - * - * You may add and remove statuses above 100, and these can be used - * to remove items from normal circulation without affecting the rest - * of the copy's values or its location. - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Copy Statuses + +The available copy statuses, and whether a copy in that +status is available for hold request capture. 0 (zero) is +the only special number in this set, meaning that the item +is available for immediate checkout, and is counted as available +in the OPAC. + +Statuses with an ID below 100 are not removable, and have special +meaning in the code. Do not change them except to translate the +textual name. + +You may add and remove statuses above 100, and these can be used +to remove items from normal circulation without affecting the rest +of the copy's values or its location. $$; CREATE TABLE config.net_access_level ( @@ -531,27 +342,10 @@ CREATE TABLE config.net_access_level ( name TEXT NOT NULL UNIQUE ); COMMENT ON TABLE config.net_access_level IS $$ -/* - * Copyright (C) 2005 Georgia Public Library Service - * Mike Rylander - * - * Patron Network Access level - * - * This will be used to inform the in-library firewall of how much - * internet access the using patron should be allowed. - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Patron Network Access level + +This will be used to inform the in-library firewall of how much +internet access the using patron should be allowed. $$; @@ -808,15 +602,10 @@ CREATE OR REPLACE FUNCTION public.force_to_isbn13( TEXT ) RETURNS TEXT AS $func$ $func$ LANGUAGE PLPERLU; COMMENT ON FUNCTION public.force_to_isbn13(TEXT) IS $$ -/* - * Copyright (C) 2011 Equinox Software - * Mike Rylander - * - * Inspired by translate_isbn1013 - * - * The force_to_isbn13 function takes an input ISBN and returns the ISBN13 - * version without hypens and with a repaired checksum if the checksum was bad - */ +Inspired by translate_isbn1013 + +The force_to_isbn13 function takes an input ISBN and returns the ISBN13 +version without hypens and with a repaired checksum if the checksum was bad $$; @@ -860,18 +649,11 @@ CREATE OR REPLACE FUNCTION public.translate_isbn1013( TEXT ) RETURNS TEXT AS $fu $func$ LANGUAGE PLPERLU; COMMENT ON FUNCTION public.translate_isbn1013(TEXT) IS $$ -/* - * Copyright (C) 2010 Merrimack Valley Library Consortium - * Jason Stephenson - * Copyright (C) 2010 Laurentian University - * Dan Scott - * - * The translate_isbn1013 function takes an input ISBN and returns the - * following in a single space-delimited string if the input ISBN is valid: - * - The normalized input ISBN (hyphens stripped) - * - The normalized input ISBN with a fixed checksum if the checksum was bad - * - The ISBN converted to its ISBN10 or ISBN13 counterpart, if possible - */ +The translate_isbn1013 function takes an input ISBN and returns the +following in a single space-delimited string if the input ISBN is valid: + - The normalized input ISBN (hyphens stripped) + - The normalized input ISBN with a fixed checksum if the checksum was bad + - The ISBN converted to its ISBN10 or ISBN13 counterpart, if possible $$; -- And ... a table in which to register them diff --git a/Open-ILS/src/sql/Pg/005.schema.actors.sql b/Open-ILS/src/sql/Pg/005.schema.actors.sql index 43fee34..f87ffa0 100644 --- a/Open-ILS/src/sql/Pg/005.schema.actors.sql +++ b/Open-ILS/src/sql/Pg/005.schema.actors.sql @@ -1,17 +1,8 @@ -DROP SCHEMA IF EXISTS actor CASCADE; - -BEGIN; -CREATE SCHEMA actor; -COMMENT ON SCHEMA actor IS $$ /* * Copyright (C) 2005-2008 Equinox Software, Inc. / Georgia Public Library Service * Mike Rylander - * - * Schema: actor - * - * Holds all tables pertaining to users and libraries (org units). - * - * **** + * Copyright (C) 2010 Laurentian University + * Dan Scott * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -23,6 +14,13 @@ COMMENT ON SCHEMA actor IS $$ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ + +DROP SCHEMA IF EXISTS actor CASCADE; + +BEGIN; +CREATE SCHEMA actor; +COMMENT ON SCHEMA actor IS $$ +Holds all tables pertaining to users and libraries (org units). $$; CREATE TABLE actor.usr ( @@ -68,28 +66,11 @@ CREATE TABLE actor.usr ( claims_never_checked_out_count INT NOT NULL DEFAULT 0 ); COMMENT ON TABLE actor.usr IS $$ -/* - * Copyright (C) 2005-2008 Equinox Software, Inc. / Georgia Public Library Service - * Mike Rylander - * - * User objects - * - * This table contains the core User objects that describe both - * staff members and patrons. The difference between the two - * types of users is based on the user's permissions. - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +User objects + +This table contains the core User objects that describe both +staff members and patrons. The difference between the two +types of users is based on the user's permissions. $$; CREATE INDEX actor_usr_home_ou_idx ON actor.usr (home_ou); @@ -156,27 +137,10 @@ CREATE TABLE actor.usr_setting ( CONSTRAINT usr_once_per_key UNIQUE (usr,name) ); COMMENT ON TABLE actor.usr_setting IS $$ -/* - * Copyright (C) 2005-2008 Equinox Software, Inc. / Georgia Public Library Service - * Mike Rylander - * - * User settings - * - * This table contains any arbitrary settings that a client - * program would like to save for a user. - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +User settings + +This table contains any arbitrary settings that a client +program would like to save for a user. $$; CREATE INDEX actor_usr_setting_usr_idx ON actor.usr_setting (usr); @@ -191,27 +155,10 @@ CREATE TABLE actor.stat_cat ( CONSTRAINT sc_once_per_owner UNIQUE (owner,name) ); COMMENT ON TABLE actor.stat_cat IS $$ -/* - * Copyright (C) 2005-2008 Equinox Software, Inc. / Georgia Public Library Service - * Mike Rylander - * - * User Statistical Catagories - * - * Local data collected about Users is placed into a Statistical - * Catagory. Here's where those catagories are defined. - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +User Statistical Catagories + +Local data collected about Users is placed into a Statistical +Catagory. Here's where those catagories are defined. $$; @@ -223,29 +170,11 @@ CREATE TABLE actor.stat_cat_entry ( CONSTRAINT sce_once_per_owner UNIQUE (stat_cat,owner,value) ); COMMENT ON TABLE actor.stat_cat_entry IS $$ -/* - * Copyright (C) 2005-2008 Equinox Software, Inc. / Georgia Public Library Service - * Mike Rylander - * - * User Statistical Catagory Entries - * - * Local data collected about Users is placed into a Statistical - * Catagory. Each library can create entries into any of its own - * stat_cats, its ancestors' stat_cats, or its descendants' stat_cats. - * - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +User Statistical Catagory Entries + +Local data collected about Users is placed into a Statistical +Catagory. Each library can create entries into any of its own +stat_cats, its ancestors' stat_cats, or its descendants' stat_cats. $$; @@ -257,27 +186,9 @@ CREATE TABLE actor.stat_cat_entry_usr_map ( CONSTRAINT sc_once_per_usr UNIQUE (target_usr,stat_cat) ); COMMENT ON TABLE actor.stat_cat_entry_usr_map IS $$ -/* - * Copyright (C) 2005-2008 Equinox Software, Inc. / Georgia Public Library Service - * Mike Rylander - * - * Statistical Catagory Entry to User map - * - * Records the stat_cat entries for each user. - * - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Statistical Catagory Entry to User map + +Records the stat_cat entries for each user. $$; CREATE INDEX actor_stat_cat_entry_usr_idx ON actor.stat_cat_entry_usr_map (target_usr); @@ -289,30 +200,12 @@ CREATE TABLE actor.card ( active BOOL NOT NULL DEFAULT TRUE ); COMMENT ON TABLE actor.card IS $$ -/* - * Copyright (C) 2005-2008 Equinox Software, Inc. / Georgia Public Library Service - * Mike Rylander - * - * Library Cards - * - * Each User has one or more library cards. The current "main" - * card is linked to here from the actor.usr table, and it is up - * to the consortium policy whether more than one card can be - * active for any one user at a given time. - * - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Library Cards + +Each User has one or more library cards. The current "main" +card is linked to here from the actor.usr table, and it is up +to the consortium policy whether more than one card can be +active for any one user at a given time. $$; CREATE INDEX actor_card_usr_idx ON actor.card (usr); @@ -470,27 +363,10 @@ CREATE TABLE actor.org_unit_setting ( CONSTRAINT ou_once_per_key UNIQUE (org_unit,name) ); COMMENT ON TABLE actor.org_unit_setting IS $$ -/* - * Copyright (C) 2005-2008 Equinox Software, Inc. / Georgia Public Library Service - * Mike Rylander - * - * Org Unit settings - * - * This table contains any arbitrary settings that a client - * program would like to save for an org unit. - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Org Unit settings + +This table contains any arbitrary settings that a client +program would like to save for an org unit. $$; CREATE INDEX actor_org_unit_setting_usr_idx ON actor.org_unit_setting (org_unit); @@ -530,24 +406,7 @@ CREATE TABLE actor.usr_password_reset ( has_been_reset BOOL NOT NULL DEFAULT false ); COMMENT ON TABLE actor.usr_password_reset IS $$ -/* - * Copyright (C) 2010 Laurentian University - * Dan Scott - * - * Self-serve password reset requests - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Self-serve password reset requests $$; CREATE UNIQUE INDEX actor_usr_password_reset_uuid_idx ON actor.usr_password_reset (uuid); CREATE INDEX actor_usr_password_reset_usr_idx ON actor.usr_password_reset (usr); @@ -586,24 +445,7 @@ CREATE TABLE actor.usr_standing_penalty ( note TEXT ); COMMENT ON TABLE actor.usr_standing_penalty IS $$ -/* - * Copyright (C) 2005-2008 Equinox Software, Inc. / Georgia Public Library Service - * Mike Rylander - * - * User standing penalties - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +User standing penalties $$; CREATE INDEX actor_usr_standing_penalty_usr_idx ON actor.usr_standing_penalty (usr); diff --git a/Open-ILS/src/sql/Pg/008.schema.query.sql b/Open-ILS/src/sql/Pg/008.schema.query.sql index 7f489a0..1dc97b1 100644 --- a/Open-ILS/src/sql/Pg/008.schema.query.sql +++ b/Open-ILS/src/sql/Pg/008.schema.query.sql @@ -1,21 +1,7 @@ --- Script to create the query schema and the tables therein - -BEGIN; - -DROP SCHEMA IF EXISTS query CASCADE; -CREATE SCHEMA query; -COMMENT ON SCHEMA actor IS $$ /* * Copyright (C) 2009 Equinox Software, Inc. / Georgia Public Library Service * Scott McKellar * - * Schema: query - * - * Contains tables designed to represent user-defined queries for - * reports and the like. - * - * **** - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -26,6 +12,14 @@ COMMENT ON SCHEMA actor IS $$ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ + +BEGIN; + +DROP SCHEMA IF EXISTS query CASCADE; +CREATE SCHEMA query; +COMMENT ON SCHEMA query IS $$ +Contains tables designed to represent user-defined queries for +reports and the like. $$; CREATE TABLE query.stored_query ( diff --git a/Open-ILS/src/sql/Pg/020.schema.functions.sql b/Open-ILS/src/sql/Pg/020.schema.functions.sql index a9b9cce..f7c43c5 100644 --- a/Open-ILS/src/sql/Pg/020.schema.functions.sql +++ b/Open-ILS/src/sql/Pg/020.schema.functions.sql @@ -323,10 +323,8 @@ END; $$ LANGUAGE plpgsql STABLE ROWS 1; COMMENT ON FUNCTION actor.org_unit_ancestor_setting( TEXT, INT) IS $$ -/** -* Search "up" the org_unit tree until we find the first occurrence of an -* org_unit_setting with the given name. -*/ +Search "up" the org_unit tree until we find the first occurrence of an +org_unit_setting with the given name. $$; -- Intended to be used in a unique index on authority.record_entry like so: @@ -410,10 +408,8 @@ CREATE OR REPLACE FUNCTION authority.normalize_heading( TEXT ) RETURNS TEXT AS $ $func$ LANGUAGE 'plperlu' IMMUTABLE; COMMENT ON FUNCTION authority.normalize_heading( TEXT ) IS $$ -/** -* Extract the authority heading, thesaurus, and NACO-normalized values -* from an authority record. The primary purpose is to build a unique -* index to defend against duplicated authority records from the same -* thesaurus. -*/ +Extract the authority heading, thesaurus, and NACO-normalized values +from an authority record. The primary purpose is to build a unique +index to defend against duplicated authority records from the same +thesaurus. $$; diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql index 12dbec0..f15107d 100644 --- a/Open-ILS/src/sql/Pg/090.schema.action.sql +++ b/Open-ILS/src/sql/Pg/090.schema.action.sql @@ -915,13 +915,11 @@ END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION action.apply_fieldset( INT, TEXT, TEXT, TEXT ) IS $$ -/** - * Applies a specified fieldset, using a supplied table name and primary - * key name. The query parameter should be non-null only for - * query-based fieldsets. - * - * Returns NULL if successful, or an error message if not. - */ +Applies a specified fieldset, using a supplied table name and primary +key name. The query parameter should be non-null only for +query-based fieldsets. + +Returns NULL if successful, or an error message if not. $$; diff --git a/Open-ILS/src/sql/Pg/200.schema.acq.sql b/Open-ILS/src/sql/Pg/200.schema.acq.sql index 6e84c05..e8869a3 100644 --- a/Open-ILS/src/sql/Pg/200.schema.acq.sql +++ b/Open-ILS/src/sql/Pg/200.schema.acq.sql @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2009 Georgia Public Library Service + * Scott McKellar + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + DROP SCHEMA IF EXISTS acq CASCADE; BEGIN; @@ -179,40 +194,23 @@ CREATE VIEW acq.ordered_funding_source_credit AS acq.funding_source_credit; COMMENT ON VIEW acq.ordered_funding_source_credit IS $$ -/* - * Copyright (C) 2009 Georgia Public Library Service - * Scott McKellar - * - * The acq.ordered_funding_source_credit view is a prioritized - * ordering of funding source credits. When ordered by the first - * three columns, this view defines the order in which the various - * credits are to be tapped for spending, subject to the allocations - * in the acq.fund_allocation table. - * - * The first column reflects the principle that we should spend - * money with deadlines before spending money without deadlines. - * - * The second column reflects the principle that we should spend the - * oldest money first. For money with deadlines, that means that we - * spend first from the credit with the earliest deadline. For - * money without deadlines, we spend first from the credit with the - * earliest effective date. - * - * The third column is a tie breaker to ensure a consistent - * ordering. - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +The acq.ordered_funding_source_credit view is a prioritized +ordering of funding source credits. When ordered by the first +three columns, this view defines the order in which the various +credits are to be tapped for spending, subject to the allocations +in the acq.fund_allocation table. + +The first column reflects the principle that we should spend +money with deadlines before spending money without deadlines. + +The second column reflects the principle that we should spend the +oldest money first. For money with deadlines, that means that we +spend first from the credit with the earliest deadline. For +money without deadlines, we spend first from the credit with the +earliest effective date. + +The third column is a tie breaker to ensure a consistent +ordering. $$; CREATE TABLE acq.fund ( @@ -687,35 +685,17 @@ CREATE INDEX acqftr_usr_idx ON acq.fund_transfer( transfer_user ); COMMENT ON TABLE acq.fund_transfer IS $$ -/* - * Copyright (C) 2009 Georgia Public Library Service - * Scott McKellar - * - * Fund Transfer - * - * Each row represents the transfer of money from a source fund - * to a destination fund. There should be corresponding entries - * in acq.fund_allocation. The purpose of acq.fund_transfer is - * to record how much money moved from which fund to which other - * fund. - * - * The presence of two amount fields, rather than one, reflects - * the possibility that the two funds are denominated in different - * currencies. If they use the same currency type, the two - * amounts should be the same. - * - * **** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +Fund Transfer +Each row represents the transfer of money from a source fund +to a destination fund. There should be corresponding entries +in acq.fund_allocation. The purpose of acq.fund_transfer is +to record how much money moved from which fund to which other +fund. + +The presence of two amount fields, rather than one, reflects +the possibility that the two funds are denominated in different +currencies. If they use the same currency type, the two +amounts should be the same. $$; CREATE TABLE acq.fiscal_calendar ( diff --git a/Open-ILS/src/sql/Pg/999.functions.global.sql b/Open-ILS/src/sql/Pg/999.functions.global.sql index 1e29db3..71c45c3 100644 --- a/Open-ILS/src/sql/Pg/999.functions.global.sql +++ b/Open-ILS/src/sql/Pg/999.functions.global.sql @@ -37,10 +37,8 @@ END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION actor.usr_merge_rows(TEXT, TEXT, INT, INT) IS $$ -/** - * Attempts to move each row of the specified table from src_user to dest_user. - * Where conflicts exist, the conflicting "source" row is deleted. - */ +Attempts to move each row of the specified table from src_user to dest_user. +Where conflicts exist, the conflicting "source" row is deleted. $$; @@ -360,10 +358,8 @@ END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION actor.usr_merge(INT, INT, BOOLEAN, BOOLEAN, BOOLEAN) IS $$ -/** - * Merges all user date from src_usr to dest_usr. When collisions occur, - * keep dest_usr's data and delete src_usr's data. - */ +Merges all user date from src_usr to dest_usr. When collisions occur, +keep dest_usr's data and delete src_usr's data. $$; @@ -692,10 +688,8 @@ END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION actor.usr_purge_data(INT, INT) IS $$ -/** - * Finds rows dependent on a given row in actor.usr and either deletes them - * or reassigns them to a different user. - */ +Finds rows dependent on a given row in actor.usr and either deletes them +or reassigns them to a different user. $$; @@ -814,10 +808,8 @@ END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION actor.usr_delete(INT, INT) IS $$ -/** - * Logically deletes a user. Removes personally identifiable information, - * and purges associated data in other tables. - */ +Logically deletes a user. Removes personally identifiable information, +and purges associated data in other tables. $$; @@ -840,10 +832,8 @@ END $$ LANGUAGE plpgsql; COMMENT ON FUNCTION actor.approve_pending_address(INT) IS $$ -/** - * Replaces an address with a pending address. This is done by giving the pending - * address the ID of the old address. The replaced address is retained with -id. - */ +Replaces an address with a pending address. This is done by giving the pending +address the ID of the old address. The replaced address is retained with -id. $$; CREATE OR REPLACE FUNCTION container.clear_expired_circ_history_items( @@ -904,11 +894,9 @@ END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION container.clear_expired_circ_history_items( INTEGER ) IS $$ -/* - * Delete old circulation bucket items for a specified user. - * "Old" means older than the interval specified by a - * user-level setting, if it is so specified. -*/ +Delete old circulation bucket items for a specified user. +"Old" means older than the interval specified by a +user-level setting, if it is so specified. $$; CREATE OR REPLACE FUNCTION container.clear_all_expired_circ_history_items( ) @@ -966,10 +954,8 @@ END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION container.clear_all_expired_circ_history_items( ) IS $$ -/* - * Delete expired circulation bucket items for all users that have - * a setting for patron.max_reading_list_interval. -*/ +Delete expired circulation bucket items for all users that have +a setting for patron.max_reading_list_interval. $$; CREATE OR REPLACE FUNCTION asset.merge_record_assets( target_record BIGINT, source_record BIGINT ) RETURNS INT AS $func$ -- 1.7.2.5