/*
* Copyright (C) 2004-2008 Georgia Public Library Service
- * Copyright (C) 2008 Equinox Software, Inc.
+ * Copyright (C) 2008-2011 Equinox Software, Inc.
* Mike Rylander <miker@esilibrary.com>
+ * Copyright (C) 2010 Merrimack Valley Library Consortium
+ * Jason Stephenson <jstephenson@mvlc.org>
+ * Copyright (C) 2010 Laurentian University
+ * Dan Scott <dscott@laurentian.ca>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
CREATE SCHEMA config;
COMMENT ON SCHEMA config IS $$
-/*
- * Copyright (C) 2005 Georgia Public Library Service
- * Mike Rylander <mrylander@gmail.com>
- *
- * 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 (
transcendant BOOL NOT NULL DEFAULT FALSE
);
COMMENT ON TABLE config.bib_source IS $$
-/*
- * Copyright (C) 2005 Georgia Public Library Service
- * Mike Rylander <mrylander@gmail.com>
- *
- * 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 (
value TEXT NOT NULL UNIQUE
);
COMMENT ON TABLE config.standing IS $$
-/*
- * Copyright (C) 2005 Georgia Public Library Service
- * Mike Rylander <mrylander@gmail.com>
- *
- * 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 (
facet_xpath TEXT
);
COMMENT ON TABLE config.metabib_field IS $$
-/*
- * Copyright (C) 2005 Georgia Public Library Service
- * Mike Rylander <mrylander@gmail.com>
- *
- * 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);
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 <mrylander@gmail.com>
- *
- * 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 (
name TEXT NOT NULL UNIQUE
);
COMMENT ON TABLE config.identification_type IS $$
-/*
- * Copyright (C) 2005 Georgia Public Library Service
- * Mike Rylander <mrylander@gmail.com>
- *
- * 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 (
max_renewals INT NOT NULL
);
COMMENT ON TABLE config.rule_circ_duration IS $$
-/*
- * Copyright (C) 2005 Georgia Public Library Service
- * Mike Rylander <mrylander@gmail.com>
- *
- * 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 (
is_percent BOOL NOT NULL DEFAULT FALSE
);
COMMENT ON TABLE config.rule_max_fine IS $$
-/*
- * Copyright (C) 2005 Georgia Public Library Service
- * Mike Rylander <mrylander@gmail.com>
- *
- * 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 (
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 <mrylander@gmail.com>
- *
- * 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.
$$;
prox INT NOT NULL
);
COMMENT ON TABLE config.rule_age_hold_protect IS $$
-/*
- * Copyright (C) 2005 Georgia Public Library Service
- * Mike Rylander <mrylander@gmail.com>
- *
- * 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 (
opac_visible BOOL NOT NULL DEFAULT FALSE
);
COMMENT ON TABLE config.copy_status IS $$
-/*
- * Copyright (C) 2005 Georgia Public Library Service
- * Mike Rylander <mrylander@gmail.com>
- *
- * 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 (
name TEXT NOT NULL UNIQUE
);
COMMENT ON TABLE config.net_access_level IS $$
-/*
- * Copyright (C) 2005 Georgia Public Library Service
- * Mike Rylander <mrylander@gmail.com>
- *
- * 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.
$$;
$func$ LANGUAGE PLPERLU;
COMMENT ON FUNCTION public.force_to_isbn13(TEXT) IS $$
-/*
- * Copyright (C) 2011 Equinox Software
- * Mike Rylander <mrylander@gmail.com>
- *
- * 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
$$;
$func$ LANGUAGE PLPERLU;
COMMENT ON FUNCTION public.translate_isbn1013(TEXT) IS $$
-/*
- * Copyright (C) 2010 Merrimack Valley Library Consortium
- * Jason Stephenson <jstephenson@mvlc.org>
- * Copyright (C) 2010 Laurentian University
- * Dan Scott <dscott@laurentian.ca>
- *
- * 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
-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 <mrylander@gmail.com>
- *
- * Schema: actor
- *
- * Holds all tables pertaining to users and libraries (org units).
- *
- * ****
+ * Copyright (C) 2010 Laurentian University
+ * Dan Scott <dscott@laurentian.ca>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* 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 (
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 <mrylander@gmail.com>
- *
- * 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);
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 <mrylander@gmail.com>
- *
- * 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);
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 <mrylander@gmail.com>
- *
- * 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.
$$;
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 <mrylander@gmail.com>
- *
- * 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.
$$;
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 <mrylander@gmail.com>
- *
- * 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);
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 <mrylander@gmail.com>
- *
- * 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);
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 <mrylander@gmail.com>
- *
- * 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);
has_been_reset BOOL NOT NULL DEFAULT false
);
COMMENT ON TABLE actor.usr_password_reset IS $$
-/*
- * Copyright (C) 2010 Laurentian University
- * Dan Scott <dscott@laurentian.ca>
- *
- * 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);
note TEXT
);
COMMENT ON TABLE actor.usr_standing_penalty IS $$
-/*
- * Copyright (C) 2005-2008 Equinox Software, Inc. / Georgia Public Library Service
- * Mike Rylander <mrylander@gmail.com>
- *
- * 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);
--- 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 <scott@esilibrary.com>
*
- * 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
* 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 (
$$ 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:
$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.
$$;
$$ 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.
$$;
+/*
+ * Copyright (C) 2009 Georgia Public Library Service
+ * Scott McKellar <scott@esilibrary.com>
+ *
+ * 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;
acq.funding_source_credit;
COMMENT ON VIEW acq.ordered_funding_source_credit IS $$
-/*
- * Copyright (C) 2009 Georgia Public Library Service
- * Scott McKellar <scott@gmail.com>
- *
- * 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 (
ON acq.fund_transfer( transfer_user );
COMMENT ON TABLE acq.fund_transfer IS $$
-/*
- * Copyright (C) 2009 Georgia Public Library Service
- * Scott McKellar <scott@esilibrary.com>
- *
- * 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 (
$$ 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.
$$;
$$ 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.
$$;
$$ 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.
$$;
$$ 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.
$$;
$$ 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(
$$ 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( )
$$ 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$