Main Koha release repository https://koha-community.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

4329 lines
221 KiB

-- MySQL dump 10.9
--
-- Host: localhost Database: koha30test
-- ------------------------------------------------------
-- Server version 4.1.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `auth_header`
--
DROP TABLE IF EXISTS `auth_header`;
CREATE TABLE `auth_header` (
`authid` bigint(20) unsigned NOT NULL auto_increment,
`authtypecode` varchar(10) NOT NULL default '',
`datecreated` date default NULL,
`modification_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`origincode` varchar(20) default NULL,
`authtrees` LONGTEXT,
`marc` blob,
`linkid` bigint(20) default NULL,
`marcxml` LONGTEXT NOT NULL,
PRIMARY KEY (`authid`),
KEY `origincode` (`origincode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `auth_types`
--
DROP TABLE IF EXISTS `auth_types`;
CREATE TABLE `auth_types` (
`authtypecode` varchar(10) NOT NULL default '',
`authtypetext` varchar(255) NOT NULL default '',
`auth_tag_to_report` varchar(3) NOT NULL default '',
`summary` LONGTEXT NOT NULL,
PRIMARY KEY (`authtypecode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `auth_subfield_structure`
--
DROP TABLE IF EXISTS `auth_subfield_structure`;
CREATE TABLE `auth_subfield_structure` (
`authtypecode` varchar(10) NOT NULL default '',
`tagfield` varchar(3) NOT NULL default '',
`tagsubfield` varchar(1) NOT NULL default '',
`liblibrarian` varchar(255) NOT NULL default '',
`libopac` varchar(255) NOT NULL default '',
`repeatable` tinyint(4) NOT NULL default 0,
`mandatory` tinyint(4) NOT NULL default 0,
`tab` tinyint(1) default NULL,
`authorised_value` varchar(10) default NULL,
`value_builder` varchar(80) default NULL,
`seealso` varchar(255) default NULL,
`isurl` tinyint(1) default NULL,
`hidden` tinyint(3) NOT NULL default 0,
`linkid` tinyint(1) NOT NULL default 0,
`kohafield` varchar(45) NULL default '',
`frameworkcode` varchar(10) NOT NULL default '',
`defaultvalue` MEDIUMTEXT,
PRIMARY KEY (`authtypecode`,`tagfield`,`tagsubfield`),
KEY `tab` (`authtypecode`,`tab`),
CONSTRAINT `auth_subfield_structure_ibfk_1` FOREIGN KEY (`authtypecode`) REFERENCES `auth_types` (`authtypecode`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `auth_tag_structure`
--
DROP TABLE IF EXISTS `auth_tag_structure`;
CREATE TABLE `auth_tag_structure` (
`authtypecode` varchar(10) NOT NULL default '',
`tagfield` varchar(3) NOT NULL default '',
`liblibrarian` varchar(255) NOT NULL default '',
`libopac` varchar(255) NOT NULL default '',
`repeatable` tinyint(4) NOT NULL default 0,
`mandatory` tinyint(4) NOT NULL default 0,
`authorised_value` varchar(10) default NULL,
PRIMARY KEY (`authtypecode`,`tagfield`),
CONSTRAINT `auth_tag_structure_ibfk_1` FOREIGN KEY (`authtypecode`) REFERENCES `auth_types` (`authtypecode`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `authorised_value_categories`
--
DROP TABLE IF EXISTS `authorised_value_categories`;
CREATE TABLE `authorised_value_categories` (
`category_name` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`category_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `authorised_values`
--
DROP TABLE IF EXISTS `authorised_values`;
CREATE TABLE `authorised_values` ( -- stores values for authorized values categories and values
`id` int(11) NOT NULL auto_increment, -- unique key, used to identify the authorized value
`category` varchar(32) NOT NULL default '', -- key used to identify the authorized value category
`authorised_value` varchar(80) NOT NULL default '', -- code use to identify the authorized value
`lib` varchar(200) default NULL, -- authorized value description as printed in the staff client
`lib_opac` varchar(200) default NULL, -- authorized value description as printed in the OPAC
`imageurl` varchar(200) default NULL, -- authorized value URL
PRIMARY KEY (`id`),
KEY `name` (`category`),
KEY `lib` (`lib` (191)),
KEY `auth_value_idx` (`authorised_value`),
CONSTRAINT `authorised_values_authorised_values_category` FOREIGN KEY (`category`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `biblio`
--
DROP TABLE IF EXISTS `biblio`;
CREATE TABLE `biblio` ( -- table that stores bibliographic information
`biblionumber` int(11) NOT NULL auto_increment, -- unique identifier assigned to each bibliographic record
`frameworkcode` varchar(4) NOT NULL default '', -- foreign key from the biblio_framework table to identify which framework was used in cataloging this record
`author` LONGTEXT, -- statement of responsibility from MARC record (100$a in MARC21)
`title` LONGTEXT, -- title (without the subtitle) from the MARC record (245$a in MARC21)
`unititle` LONGTEXT, -- uniform title (without the subtitle) from the MARC record (240$a in MARC21)
`notes` LONGTEXT, -- values from the general notes field in the MARC record (500$a in MARC21) split by bar (|)
`serial` tinyint(1) default NULL, -- Boolean indicating whether biblio is for a serial
`seriestitle` LONGTEXT,
`copyrightdate` smallint(6) default NULL, -- publication or copyright date from the MARC record
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
`datecreated` DATE NOT NULL, -- the date this record was added to Koha
`abstract` LONGTEXT, -- summary from the MARC record (520$a in MARC21)
PRIMARY KEY (`biblionumber`),
KEY `blbnoidx` (`biblionumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `biblio_framework`
--
DROP TABLE IF EXISTS `biblio_framework`;
CREATE TABLE `biblio_framework` ( -- information about MARC frameworks
`frameworkcode` varchar(4) NOT NULL default '', -- the unique code assigned to the framework
`frameworktext` varchar(255) NOT NULL default '', -- the description/name given to the framework
PRIMARY KEY (`frameworkcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `biblioitems`
--
DROP TABLE IF EXISTS `biblioitems`;
CREATE TABLE `biblioitems` ( -- information related to bibliographic records in Koha
`biblioitemnumber` int(11) NOT NULL auto_increment, -- primary key, unique identifier assigned by Koha
`biblionumber` int(11) NOT NULL default 0, -- foreign key linking this table to the biblio table
`volume` LONGTEXT,
`number` LONGTEXT,
`itemtype` varchar(10) default NULL, -- biblio level item type (MARC21 942$c)
`isbn` LONGTEXT, -- ISBN (MARC21 020$a)
`issn` LONGTEXT, -- ISSN (MARC21 022$a)
`ean` LONGTEXT default NULL,
`publicationyear` MEDIUMTEXT,
`publishercode` varchar(255) default NULL, -- publisher (MARC21 260$b)
`volumedate` date default NULL,
`volumedesc` MEDIUMTEXT, -- volume information (MARC21 362$a)
`collectiontitle` LONGTEXT default NULL,
`collectionissn` MEDIUMTEXT default NULL,
`collectionvolume` LONGTEXT default NULL,
`editionstatement` MEDIUMTEXT default NULL,
`editionresponsibility` MEDIUMTEXT default NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`illus` varchar(255) default NULL, -- illustrations (MARC21 300$b)
`pages` varchar(255) default NULL, -- number of pages (MARC21 300$c)
`notes` LONGTEXT,
`size` varchar(255) default NULL, -- material size (MARC21 300$c)
`place` varchar(255) default NULL, -- publication place (MARC21 260$a)
`lccn` varchar(25) default NULL, -- library of congress control number (MARC21 010$a)
`url` MEDIUMTEXT default NULL, -- url (MARC21 856$u)
`cn_source` varchar(10) default NULL, -- classification source (MARC21 942$2)
`cn_class` varchar(30) default NULL,
`cn_item` varchar(10) default NULL,
`cn_suffix` varchar(10) default NULL,
`cn_sort` varchar(255) default NULL, -- normalized version of the call number used for sorting
`agerestriction` varchar(255) default NULL, -- target audience/age restriction from the bib record (MARC21 521$a)
`totalissues` int(10),
PRIMARY KEY (`biblioitemnumber`),
KEY `bibinoidx` (`biblioitemnumber`),
KEY `bibnoidx` (`biblionumber`),
KEY `itemtype_idx` (`itemtype`),
KEY `isbn` (`isbn`(255)),
KEY `issn` (`issn`(255)),
KEY `ean` (`ean`(255)),
KEY `publishercode` (`publishercode` (191)),
KEY `timestamp` (`timestamp`),
CONSTRAINT `biblioitems_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `borrower_attribute_types`
--
DROP TABLE IF EXISTS `borrower_attribute_types`;
CREATE TABLE `borrower_attribute_types` ( -- definitions for custom patron fields known as extended patron attributes
`code` varchar(10) NOT NULL, -- unique key used to identify each custom field
`description` varchar(255) NOT NULL, -- description for each custom field
`repeatable` tinyint(1) NOT NULL default 0, -- defines whether one patron/borrower can have multiple values for this custom field (1 for yes, 0 for no)
`unique_id` tinyint(1) NOT NULL default 0, -- defines if this value needs to be unique (1 for yes, 0 for no)
`opac_display` tinyint(1) NOT NULL default 0, -- defines if this field is visible to patrons on their account in the OPAC (1 for yes, 0 for no)
`opac_editable` tinyint(1) NOT NULL default 0, -- defines if this field is editable by patrons on their account in the OPAC (1 for yes, 0 for no)
`staff_searchable` tinyint(1) NOT NULL default 0, -- defines if this field is searchable via the patron search in the staff client (1 for yes, 0 for no)
`authorised_value_category` varchar(32) default NULL, -- foreign key from authorised_values that links this custom field to an authorized value category
`display_checkout` tinyint(1) NOT NULL default 0,-- defines if this field displays in checkout screens
`category_code` VARCHAR(10) NULL DEFAULT NULL,-- defines a category for an attribute_type
`class` VARCHAR(255) NOT NULL DEFAULT '',-- defines a class for an attribute_type
PRIMARY KEY (`code`),
KEY `auth_val_cat_idx` (`authorised_value_category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `borrower_password_recovery`
--
DROP TABLE IF EXISTS `borrower_password_recovery`;
CREATE TABLE IF NOT EXISTS `borrower_password_recovery` ( -- holds information about password recovery attempts
`borrowernumber` int(11) NOT NULL, -- the user asking a password recovery
`uuid` varchar(128) NOT NULL, -- a unique string to identify a password recovery attempt
`valid_until` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- a time limit on the password recovery attempt
PRIMARY KEY (`borrowernumber`),
KEY borrowernumber (borrowernumber)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `branches`
--
DROP TABLE IF EXISTS `branches`;
CREATE TABLE `branches` ( -- information about your libraries or branches are stored here
`branchcode` varchar(10) NOT NULL default '', -- a unique key assigned to each branch
`branchname` LONGTEXT NOT NULL, -- the name of your library or branch
`branchaddress1` LONGTEXT, -- the first address line of for your library or branch
`branchaddress2` LONGTEXT, -- the second address line of for your library or branch
`branchaddress3` LONGTEXT, -- the third address line of for your library or branch
`branchzip` varchar(25) default NULL, -- the zip or postal code for your library or branch
`branchcity` LONGTEXT, -- the city or province for your library or branch
`branchstate` LONGTEXT, -- the state for your library or branch
`branchcountry` MEDIUMTEXT, -- the county for your library or branch
`branchphone` LONGTEXT, -- the primary phone for your library or branch
`branchfax` LONGTEXT, -- the fax number for your library or branch
`branchemail` LONGTEXT, -- the primary email address for your library or branch
`branchreplyto` LONGTEXT, -- the email to be used as a Reply-To
`branchreturnpath` LONGTEXT, -- the email to be used as Return-Path
`branchurl` LONGTEXT, -- the URL for your library or branch's website
`issuing` tinyint(4) default NULL, -- unused in Koha
`branchip` varchar(15) default NULL, -- the IP address for your library or branch
`branchprinter` varchar(100) default NULL, -- unused in Koha
`branchnotes` LONGTEXT, -- notes related to your library or branch
opac_info MEDIUMTEXT, -- HTML that displays in OPAC
`geolocation` VARCHAR(255) default NULL, -- geolocation of your library
`marcorgcode` VARCHAR(16) default NULL, -- MARC Organization Code, see http://www.loc.gov/marc/organizations/orgshome.html, when empty defaults to syspref MARCOrgCode
`pickup_location` tinyint(1) NOT NULL default 1, -- the ability to act as a pickup location
PRIMARY KEY (`branchcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `branches_overdrive`
--
DROP TABLE IF EXISTS `branches_overdrive`;
CREATE TABLE IF NOT EXISTS branches_overdrive (
`branchcode` VARCHAR( 10 ) NOT NULL ,
`authname` VARCHAR( 255 ) NOT NULL ,
PRIMARY KEY (`branchcode`) ,
CONSTRAINT `branches_overdrive_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `browser`
--
DROP TABLE IF EXISTS `browser`;
CREATE TABLE `browser` (
`level` int(11) NOT NULL,
`classification` varchar(20) NOT NULL,
`description` varchar(255) NOT NULL,
`number` bigint(20) NOT NULL,
`endnode` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `categories`
--
DROP TABLE IF EXISTS `categories`;
CREATE TABLE `categories` ( -- this table shows information related to Koha patron categories
`categorycode` varchar(10) NOT NULL default '', -- unique primary key used to idenfity the patron category
`description` LONGTEXT, -- description of the patron category
`enrolmentperiod` smallint(6) default NULL, -- number of months the patron is enrolled for (will be NULL if enrolmentperioddate is set)
`enrolmentperioddate` DATE NULL DEFAULT NULL, -- date the patron is enrolled until (will be NULL if enrolmentperiod is set)
`upperagelimit` smallint(6) default NULL, -- age limit for the patron
`dateofbirthrequired` tinyint(1) default NULL, -- the minimum age required for the patron category
`finetype` varchar(30) default NULL, -- unused in Koha
`bulk` tinyint(1) default NULL,
`enrolmentfee` decimal(28,6) default NULL, -- enrollment fee for the patron
`overduenoticerequired` tinyint(1) default NULL, -- are overdue notices sent to this patron category (1 for yes, 0 for no)
`issuelimit` smallint(6) default NULL, -- unused in Koha
`reservefee` decimal(28,6) default NULL, -- cost to place holds
`hidelostitems` tinyint(1) NOT NULL default '0', -- are lost items shown to this category (1 for yes, 0 for no)
`category_type` varchar(1) NOT NULL default 'A', -- type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff)
`BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions
`default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category
`checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron category if this item has previously been checked out to this patron if 'yes', not if 'no', defer to syspref setting if 'inherit'.
PRIMARY KEY (`categorycode`),
UNIQUE KEY `categorycode` (`categorycode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table: collections
--
DROP TABLE IF EXISTS collections;
CREATE TABLE collections (
colId integer(11) NOT NULL auto_increment,
colTitle varchar(100) NOT NULL DEFAULT '',
colDesc MEDIUMTEXT NOT NULL,
colBranchcode varchar(10) DEFAULT NULL, -- 'branchcode for branch where item should be held.'
PRIMARY KEY (colId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Constraints for table `collections`
--
ALTER TABLE `collections`
ADD CONSTRAINT `collections_ibfk_1` FOREIGN KEY (`colBranchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Table: collections_tracking
--
DROP TABLE IF EXISTS collections_tracking;
CREATE TABLE collections_tracking (
collections_tracking_id integer(11) NOT NULL auto_increment,
colId integer(11) NOT NULL DEFAULT 0 comment 'collections.colId',
itemnumber integer(11) NOT NULL DEFAULT 0 comment 'items.itemnumber',
PRIMARY KEY (collections_tracking_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `branch_borrower_circ_rules`
--
DROP TABLE IF EXISTS `branch_borrower_circ_rules`;
CREATE TABLE `branch_borrower_circ_rules` ( -- includes default circulation rules for patron categories found under "Checkout limit by patron category"
`branchcode` VARCHAR(10) NOT NULL, -- the branch this rule applies to (branches.branchcode)
`categorycode` VARCHAR(10) NOT NULL, -- the patron category this rule applies to (categories.categorycode)
`maxissueqty` int(4) default NULL, -- the maximum number of checkouts this patron category can have at this branch
`maxonsiteissueqty` int(4) default NULL, -- the maximum number of on-site checkouts this patron category can have at this branch
PRIMARY KEY (`categorycode`, `branchcode`),
CONSTRAINT `branch_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `branch_borrower_circ_rules_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `default_borrower_circ_rules`
--
DROP TABLE IF EXISTS `default_borrower_circ_rules`;
CREATE TABLE `default_borrower_circ_rules` ( -- default checkout rules found under "Default checkout, hold and return policy"
`categorycode` VARCHAR(10) NOT NULL, -- patron category this rul
`maxissueqty` int(4) default NULL,
`maxonsiteissueqty` int(4) default NULL,
PRIMARY KEY (`categorycode`),
CONSTRAINT `borrower_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `default_branch_circ_rules`
--
DROP TABLE IF EXISTS `default_branch_circ_rules`;
CREATE TABLE `default_branch_circ_rules` (
`branchcode` VARCHAR(10) NOT NULL,
`maxissueqty` int(4) default NULL,
`maxonsiteissueqty` int(4) default NULL,
`holdallowed` tinyint(1) default NULL,
hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any', -- limit trapping of holds by branchcode
`returnbranch` varchar(15) default NULL,
PRIMARY KEY (`branchcode`),
CONSTRAINT `default_branch_circ_rules_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `default_circ_rules`
--
DROP TABLE IF EXISTS `default_circ_rules`;
CREATE TABLE `default_circ_rules` (
`singleton` enum('singleton') NOT NULL default 'singleton',
`maxissueqty` int(4) default NULL,
`maxonsiteissueqty` int(4) default NULL,
`holdallowed` int(1) default NULL,
hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any', -- limit trapping of holds by branchcode
`returnbranch` varchar(15) default NULL,
PRIMARY KEY (`singleton`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `cities`
--
DROP TABLE IF EXISTS `cities`;
CREATE TABLE `cities` ( -- authorized values for cities/states/countries to choose when adding/editing a patron/borrower
`cityid` int(11) NOT NULL auto_increment, -- unique identifier added by Koha
`city_name` varchar(100) NOT NULL default '', -- name of the city
`city_state` VARCHAR( 100 ) NULL DEFAULT NULL, -- name of the state/province
`city_country` VARCHAR( 100 ) NULL DEFAULT NULL, -- name of the country
`city_zipcode` varchar(20) default NULL, -- zip or postal code
PRIMARY KEY (`cityid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `class_sort_rules`
--
DROP TABLE IF EXISTS `class_sort_rules`;
CREATE TABLE `class_sort_rules` (
`class_sort_rule` varchar(10) NOT NULL default '',
`description` LONGTEXT,
`sort_routine` varchar(30) NOT NULL default '',
PRIMARY KEY (`class_sort_rule`),
UNIQUE KEY `class_sort_rule_idx` (`class_sort_rule`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `class_sources`
--
DROP TABLE IF EXISTS `class_sources`;
CREATE TABLE `class_sources` (
`cn_source` varchar(10) NOT NULL default '',
`description` LONGTEXT,
`used` tinyint(4) NOT NULL default 0,
`class_sort_rule` varchar(10) NOT NULL default '',
PRIMARY KEY (`cn_source`),
UNIQUE KEY `cn_source_idx` (`cn_source`),
KEY `used_idx` (`used`),
CONSTRAINT `class_source_ibfk_1` FOREIGN KEY (`class_sort_rule`) REFERENCES `class_sort_rules` (`class_sort_rule`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `currency`
--
DROP TABLE IF EXISTS `currency`;
CREATE TABLE `currency` (
`currency` varchar(10) NOT NULL default '',
`symbol` varchar(5) default NULL,
`isocode` varchar(5) default NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`rate` float(15,5) default NULL,
`active` tinyint(1) default NULL,
`archived` tinyint(1) DEFAULT 0,
`p_sep_by_space` tinyint(1) DEFAULT 0,
PRIMARY KEY (`currency`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `deletedbiblio`
--
DROP TABLE IF EXISTS `deletedbiblio`;
CREATE TABLE `deletedbiblio` ( -- stores information about bibliographic records that have been deleted
`biblionumber` int(11) NOT NULL auto_increment, -- unique identifier assigned to each bibliographic record
`frameworkcode` varchar(4) NOT NULL default '', -- foriegn key from the biblio_framework table to identify which framework was used in cataloging this record
`author` LONGTEXT, -- statement of responsibility from MARC record (100$a in MARC21)
`title` LONGTEXT, -- title (without the subtitle) from the MARC record (245$a in MARC21)
`unititle` LONGTEXT, -- uniform title (without the subtitle) from the MARC record (240$a in MARC21)
`notes` LONGTEXT, -- values from the general notes field in the MARC record (500$a in MARC21) split by bar (|)
`serial` tinyint(1) default NULL, -- Boolean indicating whether biblio is for a serial
`seriestitle` LONGTEXT,
`copyrightdate` smallint(6) default NULL, -- publication or copyright date from the MARC record
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
`datecreated` DATE NOT NULL, -- the date this record was added to Koha
`abstract` LONGTEXT, -- summary from the MARC record (520$a in MARC21)
PRIMARY KEY (`biblionumber`),
KEY `blbnoidx` (`biblionumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `deletedbiblioitems`
--
DROP TABLE IF EXISTS `deletedbiblioitems`;
CREATE TABLE `deletedbiblioitems` ( -- information about bibliographic records that have been deleted
`biblioitemnumber` int(11) NOT NULL default 0, -- primary key, unique identifier assigned by Koha
`biblionumber` int(11) NOT NULL default 0, -- foreign key linking this table to the biblio table
`volume` LONGTEXT,
`number` LONGTEXT,
`itemtype` varchar(10) default NULL, -- biblio level item type (MARC21 942$c)
`isbn` LONGTEXT default NULL, -- ISBN (MARC21 020$a)
`issn` LONGTEXT default NULL, -- ISSN (MARC21 022$a)
`ean` LONGTEXT default NULL,
`publicationyear` MEDIUMTEXT,
`publishercode` varchar(255) default NULL, -- publisher (MARC21 260$b)
`volumedate` date default NULL,
`volumedesc` MEDIUMTEXT, -- volume information (MARC21 362$a)
`collectiontitle` LONGTEXT default NULL,
`collectionissn` MEDIUMTEXT default NULL,
`collectionvolume` LONGTEXT default NULL,
`editionstatement` MEDIUMTEXT default NULL,
`editionresponsibility` MEDIUMTEXT default NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`illus` varchar(255) default NULL, -- illustrations (MARC21 300$b)
`pages` varchar(255) default NULL, -- number of pages (MARC21 300$c)
`notes` LONGTEXT,
`size` varchar(255) default NULL, -- material size (MARC21 300$c)
`place` varchar(255) default NULL, -- publication place (MARC21 260$a)
`lccn` varchar(25) default NULL, -- library of congress control number (MARC21 010$a)
`url` MEDIUMTEXT default NULL, -- url (MARC21 856$u)
`cn_source` varchar(10) default NULL, -- classification source (MARC21 942$2)
`cn_class` varchar(30) default NULL,
`cn_item` varchar(10) default NULL,
`cn_suffix` varchar(10) default NULL,
`cn_sort` varchar(255) default NULL, -- normalized version of the call number used for sorting
`agerestriction` varchar(255) default NULL, -- target audience/age restriction from the bib record (MARC21 521$a)
`totalissues` int(10),
PRIMARY KEY (`biblioitemnumber`),
KEY `bibinoidx` (`biblioitemnumber`),
KEY `bibnoidx` (`biblionumber`),
KEY `itemtype_idx` (`itemtype`),
KEY `isbn` (`isbn`(255)),
KEY `ean` (`ean`(255)),
KEY `publishercode` (`publishercode` (191)),
KEY `timestamp` (`timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `deletedborrowers`
--
DROP TABLE IF EXISTS `deletedborrowers`;
CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrowers you have deleted
`borrowernumber` int(11) NOT NULL default 0, -- primary key, Koha assigned ID number for patrons/borrowers
`cardnumber` varchar(32) default NULL, -- unique key, library assigned ID number for patrons/borrowers
`surname` LONGTEXT, -- patron/borrower's last name (surname)
`firstname` MEDIUMTEXT, -- patron/borrower's first name
`title` LONGTEXT, -- patron/borrower's title, for example: Mr. or Mrs.
`othernames` LONGTEXT, -- any other names associated with the patron/borrower
`initials` MEDIUMTEXT, -- initials for your patron/borrower
`streetnumber` varchar(10) default NULL, -- the house number for your patron/borrower's primary address
`streettype` varchar(50) default NULL, -- the street type (Rd., Blvd, etc) for your patron/borrower's primary address
`address` LONGTEXT, -- the first address line for your patron/borrower's primary address
`address2` MEDIUMTEXT, -- the second address line for your patron/borrower's primary address
`city` LONGTEXT, -- the city or town for your patron/borrower's primary address
`state` MEDIUMTEXT default NULL, -- the state or province for your patron/borrower's primary address
`zipcode` varchar(25) default NULL, -- the zip or postal code for your patron/borrower's primary address
`country` MEDIUMTEXT, -- the country for your patron/borrower's primary address
`email` LONGTEXT, -- the primary email address for your patron/borrower's primary address
`phone` MEDIUMTEXT, -- the primary phone number for your patron/borrower's primary address
`mobile` varchar(50) default NULL, -- the other phone number for your patron/borrower's primary address
`fax` LONGTEXT, -- the fax number for your patron/borrower's primary address
`emailpro` MEDIUMTEXT, -- the secondary email addres for your patron/borrower's primary address
`phonepro` MEDIUMTEXT, -- the secondary phone number for your patron/borrower's primary address
`B_streetnumber` varchar(10) default NULL, -- the house number for your patron/borrower's alternate address
`B_streettype` varchar(50) default NULL, -- the street type (Rd., Blvd, etc) for your patron/borrower's alternate address
`B_address` varchar(100) default NULL, -- the first address line for your patron/borrower's alternate address
`B_address2` MEDIUMTEXT default NULL, -- the second address line for your patron/borrower's alternate address
`B_city` LONGTEXT, -- the city or town for your patron/borrower's alternate address
`B_state` MEDIUMTEXT default NULL, -- the state for your patron/borrower's alternate address
`B_zipcode` varchar(25) default NULL, -- the zip or postal code for your patron/borrower's alternate address
`B_country` MEDIUMTEXT, -- the country for your patron/borrower's alternate address
`B_email` MEDIUMTEXT, -- the patron/borrower's alternate email address
`B_phone` LONGTEXT, -- the patron/borrower's alternate phone number
`dateofbirth` date default NULL, -- the patron/borrower's date of birth (YYYY-MM-DD)
`branchcode` varchar(10) NOT NULL default '', -- foreign key from the branches table, includes the code of the patron/borrower's home branch
`categorycode` varchar(10) NOT NULL default '', -- foreign key from the categories table, includes the code of the patron category
`dateenrolled` date default NULL, -- date the patron was added to Koha (YYYY-MM-DD)
`dateexpiry` date default NULL, -- date the patron/borrower's card is set to expire (YYYY-MM-DD)
`date_renewed` date default NULL, -- date the patron/borrower's card was last renewed
`gonenoaddress` tinyint(1) default NULL, -- set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having an unconfirmed address
`lost` tinyint(1) default NULL, -- set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having lost their card
`debarred` date default NULL, -- until this date the patron can only check-in (no loans, no holds, etc.), is a fine based on days instead of money (YYYY-MM-DD)
`debarredcomment` VARCHAR(255) DEFAULT NULL, -- comment on the stop of patron
`contactname` LONGTEXT, -- used for children and profesionals to include surname or last name of guarantor or organization name
`contactfirstname` MEDIUMTEXT, -- used for children to include first name of guarantor
`contacttitle` MEDIUMTEXT, -- used for children to include title (Mr., Mrs., etc) of guarantor
`guarantorid` int(11) default NULL, -- borrowernumber used for children or professionals to link them to guarantors or organizations
`borrowernotes` LONGTEXT, -- a note on the patron/borrower's account that is only visible in the staff client
`relationship` varchar(100) default NULL, -- used for children to include the relationship to their guarantor
`sex` varchar(1) default NULL, -- patron/borrower's gender
`password` varchar(60) default NULL, -- patron/borrower's encrypted password
`flags` int(11) default NULL, -- will include a number associated with the staff member's permissions
`userid` varchar(75) default NULL, -- patron/borrower's opac and/or staff client log in
`opacnote` LONGTEXT, -- a note on the patron/borrower's account that is visible in the OPAC and staff client
`contactnote` varchar(255) default NULL, -- a note related to the patron/borrower's alternate address
`sort1` varchar(80) default NULL, -- a field that can be used for any information unique to the library
`sort2` varchar(80) default NULL, -- a field that can be used for any information unique to the library
`altcontactfirstname` varchar(255) default NULL, -- first name of alternate contact for the patron/borrower
`altcontactsurname` varchar(255) default NULL, -- surname or last name of the alternate contact for the patron/borrower
`altcontactaddress1` varchar(255) default NULL, -- the first address line for the alternate contact for the patron/borrower
`altcontactaddress2` varchar(255) default NULL, -- the second address line for the alternate contact for the patron/borrower
`altcontactaddress3` varchar(255) default NULL, -- the city for the alternate contact for the patron/borrower
`altcontactstate` MEDIUMTEXT default NULL, -- the state for the alternate contact for the patron/borrower
`altcontactzipcode` varchar(50) default NULL, -- the zipcode for the alternate contact for the patron/borrower
`altcontactcountry` MEDIUMTEXT default NULL, -- the country for the alternate contact for the patron/borrower
`altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
`smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SMS turned on)
`sms_provider_id` int(11) DEFAULT NULL, -- the provider of the mobile phone number defined in smsalertnumber
`privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history KEY `borrowernumber` (`borrowernumber`),
`privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
`checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'.
`updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others)
`lastseen` datetime default NULL, -- last time a patron has been seen (connected at the OPAC or staff interface)
`lang` varchar(25) NOT NULL default 'default', -- lang to use to send notices to this patron
`login_attempts` int(4) default 0, -- number of failed login attemps
`overdrive_auth_token` MEDIUMTEXT default NULL, -- persist OverDrive auth token
KEY borrowernumber (borrowernumber),
KEY `cardnumber` (`cardnumber`),
KEY `sms_provider_id` (`sms_provider_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `deleteditems`
--
DROP TABLE IF EXISTS `deleteditems`;
CREATE TABLE `deleteditems` (
`itemnumber` int(11) NOT NULL default 0, -- primary key and unique identifier added by Koha
`biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
`biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
`barcode` varchar(20) default NULL, -- item barcode (MARC21 952$p)
`dateaccessioned` date default NULL, -- date the item was acquired or added to Koha (MARC21 952$d)
`booksellerid` LONGTEXT default NULL, -- where the item was purchased (MARC21 952$e)
`homebranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this item (MARC21 952$a)
`price` decimal(8,2) default NULL, -- purchase price (MARC21 952$g)
`replacementprice` decimal(8,2) default NULL, -- cost the library charges to replace the item if it has been marked lost (MARC21 952$v)
`replacementpricedate` date default NULL, -- the date the price is effective from (MARC21 952$w)
`datelastborrowed` date default NULL, -- the date the item was last checked out
`datelastseen` date default NULL, -- the date the item was last see (usually the last time the barcode was scanned or inventory was done)
`stack` tinyint(1) default NULL,
`notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (MARC21 952$7)
`damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (MARC21 952$4)
`damaged_on` datetime DEFAULT NULL, -- the date and time an item was last marked as damaged, NULL if not damaged
`itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
`itemlost_on` datetime DEFAULT NULL, -- the date and time an item was last marked as lost, NULL if not lost
`withdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
`withdrawn_on` datetime DEFAULT NULL, -- the date and time an item was last marked as withdrawn, NULL if not withdrawn
`itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
`coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
`issues` smallint(6) default NULL, -- number of times this item has been checked out
`renewals` smallint(6) default NULL, -- number of times this item has been renewed
`reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
`restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (MARC21 952$5)
`itemnotes` LONGTEXT, -- public notes on this item (MARC21 952$x)
`itemnotes_nonpublic` LONGTEXT default NULL,
`holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (MARC21 952$b)
`paidfor` LONGTEXT,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered
`location` varchar(80) default NULL, -- authorized value for the shelving location for this item (MARC21 952$c)
`permanent_location` varchar(80) default NULL, -- linked to the CART and PROC temporary locations feature, stores the permanent shelving location
`onloan` date default NULL, -- defines if item is checked out (NULL for not checked out, and due date for checked out)
`cn_source` varchar(10) default NULL, -- classification source used on this item (MARC21 952$2)
`cn_sort` varchar(255) default NULL, -- normalized form of the call number (MARC21 952$o) used for sorting
`ccode` varchar(80) default NULL, -- authorized value for the collection code associated with this item (MARC21 952$8)
`materials` MEDIUMTEXT default NULL, -- materials specified (MARC21 952$3)
`uri` varchar(255) default NULL, -- URL for the item (MARC21 952$u)
`itype` varchar(10) default NULL, -- foreign key from the itemtypes table defining the type for this item (MARC21 952$y)
`more_subfields_xml` LONGTEXT default NULL, -- additional 952 subfields in XML format
`enumchron` MEDIUMTEXT default NULL, -- serial enumeration/chronology for the item (MARC21 952$h)
`copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
`stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
`new_status` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
PRIMARY KEY (`itemnumber`),
KEY `delitembarcodeidx` (`barcode`),
KEY `delitemstocknumberidx` (`stocknumber`),
KEY `delitembinoidx` (`biblioitemnumber`),
KEY `delitembibnoidx` (`biblionumber`),
KEY `delhomebranch` (`homebranch`),
KEY `delholdingbranch` (`holdingbranch`),
KEY `itype_idx` (`itype`),
KEY `timestamp` (`timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `export_format`
--
DROP TABLE IF EXISTS `export_format`;
CREATE TABLE `export_format` (
`export_format_id` int(11) NOT NULL auto_increment,
`profile` varchar(255) NOT NULL,
`description` LONGTEXT NOT NULL,
`content` LONGTEXT NOT NULL,
`csv_separator` varchar(2) NOT NULL DEFAULT ',',
`field_separator` varchar(2),
`subfield_separator` varchar(2),
`encoding` varchar(255) NOT NULL DEFAULT 'utf8',
`type` varchar(255) DEFAULT 'marc',
`used_for` varchar(255) DEFAULT 'export_records',
PRIMARY KEY (`export_format_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Used for CSV export';
--
-- Table structure for table `import_batches`
--
DROP TABLE IF EXISTS `import_batches`;
CREATE TABLE `import_batches` ( -- information about batches of marc records that have been imported
`import_batch_id` int(11) NOT NULL auto_increment, -- unique identifier and primary key
`matcher_id` int(11) default NULL, -- the id of the match rule used (matchpoints.matcher_id)
`template_id` int(11) default NULL,
`branchcode` varchar(10) default NULL,
`num_records` int(11) NOT NULL default 0, -- number of records in the file
`num_items` int(11) NOT NULL default 0, -- number of items in the file
`upload_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- date and time the file was uploaded
`overlay_action` enum('replace', 'create_new', 'use_template', 'ignore') NOT NULL default 'create_new', -- how to handle duplicate records
`nomatch_action` enum('create_new', 'ignore') NOT NULL default 'create_new', -- how to handle records where no match is found
`item_action` enum('always_add', 'add_only_for_matches', 'add_only_for_new', 'ignore', 'replace') NOT NULL default 'always_add', -- what to do with item records
`import_status` enum('staging', 'staged', 'importing', 'imported', 'reverting', 'reverted', 'cleaned') NOT NULL default 'staging', -- the status of the imported file
`batch_type` enum('batch', 'z3950', 'webservice') NOT NULL default 'batch', -- where this batch has come from
`record_type` enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio', -- type of record in the batch
`file_name` varchar(100), -- the name of the file uploaded
`comments` LONGTEXT, -- any comments added when the file was uploaded
PRIMARY KEY (`import_batch_id`),
KEY `branchcode` (`branchcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `import_records`
--
DROP TABLE IF EXISTS `import_records`;
CREATE TABLE `import_records` (
`import_record_id` int(11) NOT NULL auto_increment,
`import_batch_id` int(11) NOT NULL,
`branchcode` varchar(10) default NULL,
`record_sequence` int(11) NOT NULL default 0,
`upload_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
`import_date` DATE default NULL,
`marc` longblob NOT NULL,
`marcxml` LONGTEXT NOT NULL,
`marcxml_old` LONGTEXT NOT NULL,
`record_type` enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio',
`overlay_status` enum('no_match', 'auto_match', 'manual_match', 'match_applied') NOT NULL default 'no_match',
`status` enum('error', 'staged', 'imported', 'reverted', 'items_reverted', 'ignored') NOT NULL default 'staged',
`import_error` LONGTEXT,
`encoding` varchar(40) NOT NULL default '',
`z3950random` varchar(40) default NULL,
PRIMARY KEY (`import_record_id`),
CONSTRAINT `import_records_ifbk_1` FOREIGN KEY (`import_batch_id`)
REFERENCES `import_batches` (`import_batch_id`) ON DELETE CASCADE ON UPDATE CASCADE,
KEY `branchcode` (`branchcode`),
KEY `batch_sequence` (`import_batch_id`, `record_sequence`),
KEY `batch_id_record_type` (`import_batch_id`,`record_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for `import_record_matches`
--
DROP TABLE IF EXISTS `import_record_matches`;
CREATE TABLE `import_record_matches` ( -- matches found when importing a batch of records
`import_record_id` int(11) NOT NULL, -- the id given to the imported bib record (import_records.import_record_id)
`candidate_match_id` int(11) NOT NULL, -- the biblio the imported record matches (biblio.biblionumber)
`score` int(11) NOT NULL default 0, -- the match score
CONSTRAINT `import_record_matches_ibfk_1` FOREIGN KEY (`import_record_id`)
REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
KEY `record_score` (`import_record_id`, `score`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `import_auths`
--
DROP TABLE IF EXISTS `import_auths`;
CREATE TABLE `import_auths` (
`import_record_id` int(11) NOT NULL,
`matched_authid` int(11) default NULL,
`control_number` varchar(25) default NULL,
`authorized_heading` varchar(128) default NULL,
`original_source` varchar(25) default NULL,
CONSTRAINT `import_auths_ibfk_1` FOREIGN KEY (`import_record_id`)
REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
KEY `matched_authid` (`matched_authid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `import_biblios`
--
DROP TABLE IF EXISTS `import_biblios`;
CREATE TABLE `import_biblios` (
`import_record_id` int(11) NOT NULL,
`matched_biblionumber` int(11) default NULL,
`control_number` varchar(25) default NULL,
`original_source` varchar(25) default NULL,
`title` varchar(128) default NULL,
`author` varchar(80) default NULL,
`isbn` varchar(30) default NULL,
`issn` varchar(9) default NULL,
`has_items` tinyint(1) NOT NULL default 0,
CONSTRAINT `import_biblios_ibfk_1` FOREIGN KEY (`import_record_id`)
REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
KEY `matched_biblionumber` (`matched_biblionumber`),
KEY `title` (`title`),
KEY `isbn` (`isbn`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `import_items`
--
DROP TABLE IF EXISTS `import_items`;
CREATE TABLE `import_items` (
`import_items_id` int(11) NOT NULL auto_increment,
`import_record_id` int(11) NOT NULL,
`itemnumber` int(11) default NULL,
`branchcode` varchar(10) default NULL,
`status` enum('error', 'staged', 'imported', 'reverted', 'ignored') NOT NULL default 'staged',
`marcxml` LONGTEXT NOT NULL,
`import_error` LONGTEXT,
PRIMARY KEY (`import_items_id`),
CONSTRAINT `import_items_ibfk_1` FOREIGN KEY (`import_record_id`)
REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
KEY `itemnumber` (`itemnumber`),
KEY `branchcode` (`branchcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `issuingrules`
--
DROP TABLE IF EXISTS `issuingrules`;
CREATE TABLE `issuingrules` ( -- circulation and fine rules
`categorycode` varchar(10) NOT NULL default '', -- patron category this rule is for (categories.categorycode)
`itemtype` varchar(10) NOT NULL default '', -- item type this rule is for (itemtypes.itemtype)
`restrictedtype` tinyint(1) default NULL, -- not used? always NULL
`rentaldiscount` decimal(28,6) default NULL, -- percent discount on the rental charge for this item
`reservecharge` decimal(28,6) default NULL,
`fine` decimal(28,6) default NULL, -- fine amount
`finedays` int(11) default NULL, -- suspension in days
`maxsuspensiondays` int(11) default NULL, -- max suspension days
`suspension_chargeperiod` int(11) default '1', -- how often the finedays is charged
`firstremind` int(11) default NULL, -- fine grace period
`chargeperiod` int(11) default NULL, -- how often the fine amount is charged
`chargeperiod_charge_at` tinyint(1) NOT NULL DEFAULT '0', -- Should fine be given at the start ( 1 ) or the end ( 0 ) of the period
`accountsent` int(11) default NULL, -- not used? always NULL
`chargename` varchar(100) default NULL, -- not used? always NULL
`maxissueqty` int(4) default NULL, -- total number of checkouts allowed
`maxonsiteissueqty` int(4) default NULL, -- total number of on-site checkouts allowed
`issuelength` int(4) default NULL, -- length of checkout in the unit set in issuingrules.lengthunit
`lengthunit` varchar(10) default 'days', -- unit of checkout length (days, hours)
`hardduedate` date default NULL, -- hard due date
`hardduedatecompare` tinyint NOT NULL default "0", -- type of hard due date (1 = after, 0 = on, -1 = before)
`renewalsallowed` smallint(6) NOT NULL default "0", -- how many renewals are allowed
`renewalperiod` int(4) default NULL, -- renewal period in the unit set in issuingrules.lengthunit
`norenewalbefore` int(4) default NULL, -- no renewal allowed until X days or hours before due date.
`auto_renew` BOOLEAN default FALSE, -- automatic renewal
`no_auto_renewal_after` int(4) default NULL, -- no auto renewal allowed after X days or hours after the issue date
`no_auto_renewal_after_hard_limit` date default NULL, -- no auto renewal allowed after a given date
`reservesallowed` smallint(6) NOT NULL default "0", -- how many holds are allowed
`holds_per_record` SMALLINT(6) NOT NULL DEFAULT 1, -- How many holds a patron can have on a given bib
`holds_per_day` SMALLINT(6) DEFAULT NULL, -- How many holds a patron can have on a day
`branchcode` varchar(10) NOT NULL default '', -- the branch this rule is for (branches.branchcode)
overduefinescap decimal(28,6) default NULL, -- the maximum amount of an overdue fine
cap_fine_to_replacement_price BOOLEAN NOT NULL DEFAULT '0', -- cap the fine based on item's replacement price
onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
PRIMARY KEY (`branchcode`,`categorycode`,`itemtype`),
KEY `categorycode` (`categorycode`),
KEY `itemtype` (`itemtype`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `refund_lost_item_fee_rules`
--
DROP TABLE IF EXISTS `refund_lost_item_fee_rules`;
CREATE TABLE `refund_lost_item_fee_rules` ( -- refund lost item fee rules tbale
`branchcode` varchar(10) NOT NULL default '', -- the branch this rule is for (branches.branchcode)
`refund` tinyint(1) NOT NULL default 0, -- control wether to refund lost item fees on return
PRIMARY KEY (`branchcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `items`
--
DROP TABLE IF EXISTS `items`;
CREATE TABLE `items` ( -- holdings/item information
`itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
`biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
`biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
`barcode` varchar(20) default NULL, -- item barcode (MARC21 952$p)
`dateaccessioned` date default NULL, -- date the item was acquired or added to Koha (MARC21 952$d)
`booksellerid` LONGTEXT default NULL, -- where the item was purchased (MARC21 952$e)
`homebranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this item (MARC21 952$a)
`price` decimal(8,2) default NULL, -- purchase price (MARC21 952$g)
`replacementprice` decimal(8,2) default NULL, -- cost the library charges to replace the item if it has been marked lost (MARC21 952$v)
`replacementpricedate` date default NULL, -- the date the price is effective from (MARC21 952$w)
`datelastborrowed` date default NULL, -- the date the item was last checked out/issued
`datelastseen` date default NULL, -- the date the item was last see (usually the last time the barcode was scanned or inventory was done)
`stack` tinyint(1) default NULL,
`notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (MARC21 952$7)
`damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (MARC21 952$4)
`damaged_on` datetime DEFAULT NULL, -- the date and time an item was last marked as damaged, NULL if not damaged
`itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
`itemlost_on` datetime DEFAULT NULL, -- the date and time an item was last marked as lost, NULL if not lost
`withdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
`withdrawn_on` datetime DEFAULT NULL, -- the date and time an item was last marked as withdrawn, NULL if not withdrawn
`itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
`coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
`issues` smallint(6) default NULL, -- number of times this item has been checked out/issued
`renewals` smallint(6) default NULL, -- number of times this item has been renewed
`reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved
`restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (MARC21 952$5)
`itemnotes` LONGTEXT, -- public notes on this item (MARC21 952$x)
`itemnotes_nonpublic` LONGTEXT default NULL,
`holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (MARC21 952$b)
`paidfor` LONGTEXT,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered
`location` varchar(80) default NULL, -- authorized value for the shelving location for this item (MARC21 952$c)
`permanent_location` varchar(80) default NULL, -- linked to the CART and PROC temporary locations feature, stores the permanent shelving location
`onloan` date default NULL, -- defines if item is checked out (NULL for not checked out, and due date for checked out)
`cn_source` varchar(10) default NULL, -- classification source used on this item (MARC21 952$2)
`cn_sort` varchar(255) default NULL, -- normalized form of the call number (MARC21 952$o) used for sorting
`ccode` varchar(80) default NULL, -- authorized value for the collection code associated with this item (MARC21 952$8)
`materials` MEDIUMTEXT default NULL, -- materials specified (MARC21 952$3)
`uri` varchar(255) default NULL, -- URL for the item (MARC21 952$u)
`itype` varchar(10) default NULL, -- foreign key from the itemtypes table defining the type for this item (MARC21 952$y)
`more_subfields_xml` LONGTEXT default NULL, -- additional 952 subfields in XML format
`enumchron` MEDIUMTEXT default NULL, -- serial enumeration/chronology for the item (MARC21 952$h)
`copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
`stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
`new_status` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
PRIMARY KEY (`itemnumber`),
UNIQUE KEY `itembarcodeidx` (`barcode`),
KEY `itemstocknumberidx` (`stocknumber`),
KEY `itembinoidx` (`biblioitemnumber`),
KEY `itembibnoidx` (`biblionumber`),
KEY `homebranch` (`homebranch`),
KEY `holdingbranch` (`holdingbranch`),
KEY `itemcallnumber` (`itemcallnumber` (191)),
KEY `items_location` (`location`),
KEY `items_ccode` (`ccode`),
KEY `itype_idx` (`itype`),
KEY `timestamp` (`timestamp`),
CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `itemtypes`
--
DROP TABLE IF EXISTS `itemtypes`;
CREATE TABLE `itemtypes` ( -- defines the item types
itemtype varchar(10) NOT NULL default '', -- unique key, a code associated with the item type
description LONGTEXT, -- a plain text explanation of the item type
rentalcharge decimal(28,6) default NULL, -- the amount charged when this item is checked out/issued
defaultreplacecost decimal(28,6) default NULL, -- default replacement cost
processfee decimal(28,6) default NULL, -- default text be recorded in the column note when the processing fee is applied
notforloan smallint(6) default NULL, -- 1 if the item is not for loan, 0 if the item is available for loan
imageurl varchar(200) default NULL, -- URL for the item type icon
summary MEDIUMTEXT, -- information from the summary field, may include HTML
checkinmsg VARCHAR(255), -- message that is displayed when an item with the given item type is checked in
checkinmsgtype CHAR(16) DEFAULT 'message' NOT NULL, -- type (CSS class) for the checkinmsg, can be "alert" or "message"
sip_media_type VARCHAR(3) DEFAULT NULL, -- SIP2 protocol media type for this itemtype
hideinopac tinyint(1) NOT NULL DEFAULT 0, -- Hide the item type from the search options in OPAC
searchcategory varchar(80) default NULL, -- Group this item type with others with the same value on OPAC search options
PRIMARY KEY (`itemtype`),
UNIQUE KEY `itemtype` (`itemtype`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `default_branch_item_rules`
--
DROP TABLE IF EXISTS `default_branch_item_rules`;
CREATE TABLE `default_branch_item_rules` (
`itemtype` varchar(10) NOT NULL,
`holdallowed` tinyint(1) default NULL,
hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any', -- limit trapping of holds by branchcode
`returnbranch` varchar(15) default NULL,
PRIMARY KEY (`itemtype`),
CONSTRAINT `default_branch_item_rules_ibfk_1` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `branchtransfers`
--
DROP TABLE IF EXISTS `branchtransfers`;
CREATE TABLE `branchtransfers` ( -- information for items that are in transit between branches
`branchtransfer_id` int(12) NOT NULL auto_increment, -- primary key
`itemnumber` int(11) NOT NULL default 0, -- the itemnumber that it is in transit (items.itemnumber)
`datesent` datetime default NULL, -- the date the transfer was initialized
`frombranch` varchar(10) NOT NULL default '', -- the branch the transfer is coming from
`datearrived` datetime default NULL, -- the date the transfer arrived at its destination
`tobranch` varchar(10) NOT NULL default '', -- the branch the transfer was going to
`comments` LONGTEXT, -- any comments related to the transfer
PRIMARY KEY (`branchtransfer_id`),
KEY `frombranch` (`frombranch`),
KEY `tobranch` (`tobranch`),
KEY `itemnumber` (`itemnumber`),
CONSTRAINT `branchtransfers_ibfk_1` FOREIGN KEY (`frombranch`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `branchtransfers_ibfk_2` FOREIGN KEY (`tobranch`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `branchtransfers_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `branch_item_rules`
--
DROP TABLE IF EXISTS `branch_item_rules`;
CREATE TABLE `branch_item_rules` ( -- information entered in the circulation and fine rules under 'Holds policy by item type'
`branchcode` varchar(10) NOT NULL, -- the branch this rule is for (branches.branchcode)
`itemtype` varchar(10) NOT NULL, -- the item type this rule applies to (items.itype)
`holdallowed` tinyint(1) default NULL, -- the number of holds allowed
hold_fulfillment_policy ENUM('any', 'homebranch', 'holdingbranch') NOT NULL DEFAULT 'any', -- limit trapping of holds by branchcode
`returnbranch` varchar(15) default NULL, -- the branch the item returns to (homebranch, holdingbranch, noreturn)
PRIMARY KEY (`itemtype`,`branchcode`),
KEY `branch_item_rules_ibfk_2` (`branchcode`),
CONSTRAINT `branch_item_rules_ibfk_1` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `branch_item_rules_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `creator_images`
--
DROP TABLE IF EXISTS `creator_images`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `creator_images` (
`image_id` int(4) NOT NULL AUTO_INCREMENT,
`imagefile` mediumblob,
`image_name` char(20) NOT NULL DEFAULT 'DEFAULT',
PRIMARY KEY (`image_id`),
UNIQUE KEY `image_name_index` (`image_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `creator_layouts`
--
DROP TABLE IF EXISTS `creator_layouts`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `creator_layouts` (
`layout_id` int(4) NOT NULL AUTO_INCREMENT,
`barcode_type` char(100) NOT NULL DEFAULT 'CODE39',
`start_label` int(2) NOT NULL DEFAULT '1',
`printing_type` char(32) NOT NULL DEFAULT 'BAR',
`layout_name` char(25) NOT NULL DEFAULT 'DEFAULT',
`guidebox` int(1) DEFAULT '0',
`oblique_title` int(1) DEFAULT '1',
`font` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TR',
`font_size` int(4) NOT NULL DEFAULT '10',
`units` char(20) NOT NULL DEFAULT 'POINT',
`callnum_split` int(1) DEFAULT '0',
`text_justify` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'L',
`format_string` varchar(210) NOT NULL DEFAULT 'barcode',
`layout_xml` MEDIUMTEXT NOT NULL,
`creator` char(15) NOT NULL DEFAULT 'Labels',
PRIMARY KEY (`layout_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `creator_templates`
--
DROP TABLE IF EXISTS `creator_templates`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `creator_templates` (
`template_id` int(4) NOT NULL AUTO_INCREMENT,
`profile_id` int(4) DEFAULT NULL,
`template_code` char(100) NOT NULL DEFAULT 'DEFAULT TEMPLATE',
`template_desc` char(100) NOT NULL DEFAULT 'Default description',
`page_width` float NOT NULL DEFAULT '0',
`page_height` float NOT NULL DEFAULT '0',
`label_width` float NOT NULL DEFAULT '0',
`label_height` float NOT NULL DEFAULT '0',
`top_text_margin` float NOT NULL DEFAULT '0',
`left_text_margin` float NOT NULL DEFAULT '0',
`top_margin` float NOT NULL DEFAULT '0',
`left_margin` float NOT NULL DEFAULT '0',
`cols` int(2) NOT NULL DEFAULT '0',
`rows` int(2) NOT NULL DEFAULT '0',
`col_gap` float NOT NULL DEFAULT '0',
`row_gap` float NOT NULL DEFAULT '0',
`units` char(20) NOT NULL DEFAULT 'POINT',
`creator` char(15) NOT NULL DEFAULT 'Labels',
PRIMARY KEY (`template_id`),
KEY `template_profile_fk_constraint` (`profile_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `marc_subfield_structure`
--
DROP TABLE IF EXISTS `marc_subfield_structure`;
CREATE TABLE `marc_subfield_structure` (
`tagfield` varchar(3) NOT NULL default '',
`tagsubfield` varchar(1) NOT NULL default '' COLLATE utf8mb4_bin,
`liblibrarian` varchar(255) NOT NULL default '',
`libopac` varchar(255) NOT NULL default '',
`repeatable` tinyint(4) NOT NULL default 0,
`mandatory` tinyint(4) NOT NULL default 0,
`kohafield` varchar(40) default NULL,
`tab` tinyint(1) default NULL,
`authorised_value` varchar(32) default NULL,
`authtypecode` varchar(20) default NULL,
`value_builder` varchar(80) default NULL,
`isurl` tinyint(1) default NULL,
`hidden` tinyint(1) default NULL,
`frameworkcode` varchar(4) NOT NULL default '',
`seealso` varchar(1100) default NULL,
`link` varchar(80) default NULL,
`defaultvalue` MEDIUMTEXT default NULL,
`maxlength` int(4) NOT NULL DEFAULT '9999',
PRIMARY KEY (`frameworkcode`,`tagfield`,`tagsubfield`),
KEY `kohafield_2` (`kohafield`),
KEY `tab` (`frameworkcode`,`tab`),
KEY `kohafield` (`frameworkcode`,`kohafield`),
CONSTRAINT `marc_subfield_structure_ibfk_1` FOREIGN KEY (`authorised_value`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `marc_tag_structure`
--
DROP TABLE IF EXISTS `marc_tag_structure`;
CREATE TABLE `marc_tag_structure` (
`tagfield` varchar(3) NOT NULL default '',
`liblibrarian` varchar(255) NOT NULL default '',
`libopac` varchar(255) NOT NULL default '',
`repeatable` tinyint(4) NOT NULL default 0,
`mandatory` tinyint(4) NOT NULL default 0,
`authorised_value` varchar(10) default NULL,
`ind1_defaultvalue` varchar(1) NOT NULL default '',
`ind2_defaultvalue` varchar(1) NOT NULL default '',
`frameworkcode` varchar(4) NOT NULL default '',
PRIMARY KEY (`frameworkcode`,`tagfield`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `marc_matchers`
--
DROP TABLE IF EXISTS `marc_matchers`;
CREATE TABLE `marc_matchers` (
`matcher_id` int(11) NOT NULL auto_increment,
`code` varchar(10) NOT NULL default '',
`description` varchar(255) NOT NULL default '',
`record_type` varchar(10) NOT NULL default 'biblio',
`threshold` int(11) NOT NULL default 0,
PRIMARY KEY (`matcher_id`),
KEY `code` (`code`),
KEY `record_type` (`record_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `matchpoints`
--
DROP TABLE IF EXISTS `matchpoints`;
CREATE TABLE `matchpoints` (
`matcher_id` int(11) NOT NULL,
`matchpoint_id` int(11) NOT NULL auto_increment,
`search_index` varchar(30) NOT NULL default '',
`score` int(11) NOT NULL default 0,
PRIMARY KEY (`matchpoint_id`),
CONSTRAINT `matchpoints_ifbk_1` FOREIGN KEY (`matcher_id`)
REFERENCES `marc_matchers` (`matcher_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `matchpoint_components`
--
DROP TABLE IF EXISTS `matchpoint_components`;
CREATE TABLE `matchpoint_components` (
`matchpoint_id` int(11) NOT NULL,
`matchpoint_component_id` int(11) NOT NULL auto_increment,
sequence int(11) NOT NULL default 0,
tag varchar(3) NOT NULL default '',
subfields varchar(40) NOT NULL default '',
offset int(4) NOT NULL default 0,
length int(4) NOT NULL default 0,
PRIMARY KEY (`matchpoint_component_id`),
KEY `by_sequence` (`matchpoint_id`, `sequence`),
CONSTRAINT `matchpoint_components_ifbk_1` FOREIGN KEY (`matchpoint_id`)
REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `matcher_component_norms`
--
DROP TABLE IF EXISTS `matchpoint_component_norms`;
CREATE TABLE `matchpoint_component_norms` (
`matchpoint_component_id` int(11) NOT NULL,
`sequence` int(11) NOT NULL default 0,
`norm_routine` varchar(50) NOT NULL default '',
KEY `matchpoint_component_norms` (`matchpoint_component_id`, `sequence`),
CONSTRAINT `matchpoint_component_norms_ifbk_1` FOREIGN KEY (`matchpoint_component_id`)
REFERENCES `matchpoint_components` (`matchpoint_component_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `matcher_matchpoints`
--
DROP TABLE IF EXISTS `matcher_matchpoints`;
CREATE TABLE `matcher_matchpoints` (
`matcher_id` int(11) NOT NULL,
`matchpoint_id` int(11) NOT NULL,
CONSTRAINT `matcher_matchpoints_ifbk_1` FOREIGN KEY (`matcher_id`)
REFERENCES `marc_matchers` (`matcher_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `matcher_matchpoints_ifbk_2` FOREIGN KEY (`matchpoint_id`)
REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `matchchecks`
--
DROP TABLE IF EXISTS `matchchecks`;
CREATE TABLE `matchchecks` (
`matcher_id` int(11) NOT NULL,
`matchcheck_id` int(11) NOT NULL auto_increment,
`source_matchpoint_id` int(11) NOT NULL,
`target_matchpoint_id` int(11) NOT NULL,
PRIMARY KEY (`matchcheck_id`),
CONSTRAINT `matcher_matchchecks_ifbk_1` FOREIGN KEY (`matcher_id`)
REFERENCES `marc_matchers` (`matcher_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `matcher_matchchecks_ifbk_2` FOREIGN KEY (`source_matchpoint_id`)
REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `matcher_matchchecks_ifbk_3` FOREIGN KEY (`target_matchpoint_id`)
REFERENCES `matchpoints` (`matchpoint_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `need_merge_authorities`
--
DROP TABLE IF EXISTS `need_merge_authorities`;
CREATE TABLE `need_merge_authorities` ( -- keeping track of authority records still to be merged by merge_authority cron job
`id` int NOT NULL auto_increment PRIMARY KEY, -- unique id
`authid` bigint NOT NULL, -- reference to original authority record
`authid_new` bigint, -- reference to optional new authority record
`reportxml` MEDIUMTEXT, -- xml showing original reporting tag
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- date and time last modified
`done` tinyint DEFAULT 0 -- indication whether merge has been executed (0=not done, 1=done, 2=in progress)
-- Note: authid and authid_new should NOT be FOREIGN keys !
-- authid may have been deleted; authid_new may be zero
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `oai_sets`
--
DROP TABLE IF EXISTS `oai_sets`;
CREATE TABLE `oai_sets` (
`id` int(11) NOT NULL auto_increment,
`spec` varchar(80) NOT NULL UNIQUE,
`name` varchar(80) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `oai_sets_descriptions`
--
DROP TABLE IF EXISTS `oai_sets_descriptions`;
CREATE TABLE `oai_sets_descriptions` (
`set_id` int(11) NOT NULL,
`description` varchar(255) NOT NULL,
CONSTRAINT `oai_sets_descriptions_ibfk_1` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `oai_sets_mappings`
--
DROP TABLE IF EXISTS `oai_sets_mappings`;
CREATE TABLE `oai_sets_mappings` (
`set_id` int(11) NOT NULL,
`marcfield` char(3) NOT NULL,
`marcsubfield` char(1) NOT NULL,
`operator` varchar(8) NOT NULL default 'equal',
`marcvalue` varchar(80) NOT NULL,
CONSTRAINT `oai_sets_mappings_ibfk_1` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `oai_sets_biblios`
--
DROP TABLE IF EXISTS `oai_sets_biblios`;
CREATE TABLE `oai_sets_biblios` (
`biblionumber` int(11) NOT NULL,
`set_id` int(11) NOT NULL,
PRIMARY KEY (`biblionumber`, `set_id`),
CONSTRAINT `oai_sets_biblios_ibfk_2` FOREIGN KEY (`set_id`) REFERENCES `oai_sets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `overduerules`
--
DROP TABLE IF EXISTS `overduerules`;
CREATE TABLE `overduerules` ( -- overdue notice status and triggers
`overduerules_id` int(11) NOT NULL AUTO_INCREMENT, -- unique identifier for the overduerules
`branchcode` varchar(10) NOT NULL default '', -- foreign key from the branches table to define which branch this rule is for (if blank it's all libraries)
`categorycode` varchar(10) NOT NULL default '', -- foreign key from the categories table to define which patron category this rule is for
`delay1` int(4) default NULL, -- number of days after the item is overdue that the first notice is sent
`letter1` varchar(20) default NULL, -- foreign key from the letter table to define which notice should be sent as the first notice
`debarred1` varchar(1) default 0, -- is the patron restricted when the first notice is sent (1 for yes, 0 for no)
`delay2` int(4) default NULL, -- number of days after the item is overdue that the second notice is sent
`debarred2` varchar(1) default 0, -- is the patron restricted when the second notice is sent (1 for yes, 0 for no)
`letter2` varchar(20) default NULL, -- foreign key from the letter table to define which notice should be sent as the second notice
`delay3` int(4) default NULL, -- number of days after the item is overdue that the third notice is sent
`letter3` varchar(20) default NULL, -- foreign key from the letter table to define which notice should be sent as the third notice
`debarred3` int(1) default 0, -- is the patron restricted when the third notice is sent (1 for yes, 0 for no)
PRIMARY KEY (`overduerules_id`),
UNIQUE KEY `overduerules_branch_cat` (`branchcode`,`categorycode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Table structure for table `pending_offline_operations`
--
-- this table is MyISAM, InnoDB tables are growing only and this table is filled/emptied/filled/emptied...
-- so MyISAM is better in this case
DROP TABLE IF EXISTS `pending_offline_operations`;
CREATE TABLE pending_offline_operations (
operationid int(11) NOT NULL AUTO_INCREMENT,
userid varchar(30) NOT NULL,
branchcode varchar(10) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`action` varchar(10) NOT NULL,
barcode varchar(20) DEFAULT NULL,
cardnumber varchar(32) DEFAULT NULL,
amount decimal(28,6) DEFAULT NULL,
PRIMARY KEY (operationid)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `printers`
--
DROP TABLE IF EXISTS `printers`;
CREATE TABLE `printers` (
`printername` varchar(40) NOT NULL default '',
`printqueue` varchar(20) default NULL,
`printtype` varchar(20) default NULL,
PRIMARY KEY (`printername`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `printers_profile`
--
DROP TABLE IF EXISTS `printers_profile`;
CREATE TABLE `printers_profile` (
`profile_id` int(4) NOT NULL auto_increment,
`printer_name` varchar(40) NOT NULL default 'Default Printer',
`template_id` int(4) NOT NULL default '0',
`paper_bin` varchar(20) NOT NULL default 'Bypass',
`offset_horz` float NOT NULL default '0',
`offset_vert` float NOT NULL default '0',
`creep_horz` float NOT NULL default '0',
`creep_vert` float NOT NULL default '0',
`units` char(20) NOT NULL default 'POINT',
`creator` char(15) NOT NULL DEFAULT 'Labels',
PRIMARY KEY (`profile_id`),
UNIQUE KEY `printername` (`printer_name`,`template_id`,`paper_bin`,`creator`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `repeatable_holidays`
--
DROP TABLE IF EXISTS `repeatable_holidays`;
CREATE TABLE `repeatable_holidays` ( -- information for the days the library is closed
`id` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha
`branchcode` varchar(10) NOT NULL default '', -- foreign key from the branches table, defines which branch this closing is for
`weekday` smallint(6) default NULL, -- day of the week (0=Sunday, 1=Monday, etc) this closing is repeated on
`day` smallint(6) default NULL, -- day of the month this closing is on
`month` smallint(6) default NULL, -- month this closing is in
`title` varchar(50) NOT NULL default '', -- title of this closing
`description` MEDIUMTEXT NOT NULL, -- description for this closing
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `reports_dictionary`
--
DROP TABLE IF EXISTS `reports_dictionary`;
CREATE TABLE reports_dictionary ( -- definitions (or snippets of SQL) stored for use in reports
`id` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha
`name` varchar(255) default NULL, -- name for this definition
`description` MEDIUMTEXT, -- description for this definition
`date_created` datetime default NULL, -- date and time this definition was created
`date_modified` datetime default NULL, -- date and time this definition was last modified
`saved_sql` MEDIUMTEXT, -- SQL snippet for us in reports
report_area varchar(6) DEFAULT NULL, -- Koha module this definition is for Circulation, Catalog, Patrons, Acquistions, Accounts)
PRIMARY KEY (id),
KEY dictionary_area_idx (report_area)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `saved_sql`
--
DROP TABLE IF EXISTS `saved_sql`;
CREATE TABLE saved_sql ( -- saved sql reports
`id` int(11) NOT NULL auto_increment, -- unique id and primary key assigned by Koha
`borrowernumber` int(11) default NULL, -- the staff member who created this report (borrowers.borrowernumber)
`date_created` datetime default NULL, -- the date this report was created
`last_modified` datetime default NULL, -- the date this report was last edited
`savedsql` MEDIUMTEXT, -- the SQL for this report
`last_run` datetime default NULL,
`report_name` varchar(255) NOT NULL default '', -- the name of this report
`type` varchar(255) default NULL, -- always 1 for tabular
`notes` MEDIUMTEXT, -- the notes or description given to this report
`cache_expiry` int NOT NULL default 300,
`public` boolean NOT NULL default FALSE,
report_area varchar(6) default NULL,
report_group varchar(80) default NULL,
report_subgroup varchar(80) default NULL,
PRIMARY KEY (`id`),
KEY sql_area_group_idx (report_group, report_subgroup),
KEY boridx (`borrowernumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for `saved_reports`
--
DROP TABLE IF EXISTS `saved_reports`;
CREATE TABLE saved_reports (
`id` int(11) NOT NULL auto_increment,
`report_id` int(11) default NULL,
`report` LONGTEXT,
`date_run` datetime default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table 'search_field'
--
DROP TABLE IF EXISTS search_field;
CREATE TABLE `search_field` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL COMMENT 'the name of the field as it will be stored in the search engine',
`label` varchar(255) NOT NULL COMMENT 'the human readable name of the field, for display',
`type` ENUM('', 'string', 'date', 'number', 'boolean', 'sum', 'isbn', 'stdno') NOT NULL COMMENT 'what type of data this holds, relevant when storing it in the search engine',
`weight` int default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY (`name` (191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `search_history`
--
DROP TABLE IF EXISTS `search_history`;
CREATE TABLE IF NOT EXISTS `search_history` ( -- patron's opac search history
`id` int(11) NOT NULL auto_increment, -- search history id
`userid` int(11) NOT NULL, -- the patron who performed the search (borrowers.borrowernumber)
`sessionid` varchar(32) NOT NULL, -- a system generated session id
`query_desc` varchar(255) NOT NULL, -- the search that was performed
`query_cgi` MEDIUMTEXT NOT NULL, -- the string to append to the search url to rerun the search
`type` varchar(16) NOT NULL DEFAULT 'biblio', -- search type, must be 'biblio' or 'authority'
`total` int(11) NOT NULL, -- the total of results found
`time` timestamp NOT NULL default CURRENT_TIMESTAMP, -- the date and time the search was run
KEY `userid` (`userid`),
KEY `sessionid` (`sessionid`),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Opac search history results';
--
-- Table structure for table 'search_marc_map'
--
DROP TABLE IF EXISTS search_marc_map;
CREATE TABLE `search_marc_map` (
id int(11) NOT NULL AUTO_INCREMENT,
index_name ENUM('biblios','authorities') NOT NULL COMMENT 'what storage index this map is for',
marc_type ENUM('marc21', 'unimarc', 'normarc') NOT NULL COMMENT 'what MARC type this map is for',
marc_field VARCHAR(255) NOT NULL COMMENT 'the MARC specifier for this field',
PRIMARY KEY(`id`),
UNIQUE key `index_name` (`index_name`, `marc_field` (191), `marc_type`),
INDEX (`index_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table 'search_marc_to_field'
--
DROP TABLE IF EXISTS search_marc_to_field;
CREATE TABLE `search_marc_to_field` (
search_marc_map_id int(11) NOT NULL,
search_field_id int(11) NOT NULL,
facet boolean DEFAULT FALSE COMMENT 'true if a facet field should be generated for this',
suggestible boolean DEFAULT FALSE COMMENT 'true if this field can be used to generate suggestions for browse',
sort boolean DEFAULT NULL COMMENT 'true/false creates special sort handling, null doesn''t',
PRIMARY KEY(search_marc_map_id, search_field_id),
FOREIGN KEY(search_marc_map_id) REFERENCES search_marc_map(id) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY(search_field_id) REFERENCES search_field(id) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `serial`
--
DROP TABLE IF EXISTS `serial`;
CREATE TABLE `serial` ( -- issues related to subscriptions
`serialid` int(11) NOT NULL auto_increment, -- unique key for the issue
`biblionumber` varchar(100) NOT NULL default '', -- foreign key for the biblio.biblionumber that this issue is attached to
`subscriptionid` varchar(100) NOT NULL default '', -- foreign key to the subscription.subscriptionid that this issue is part of
`serialseq` varchar(100) NOT NULL default '', -- issue information (volume, number, etc)
`serialseq_x` varchar( 100 ) NULL DEFAULT NULL, -- first part of issue information
`serialseq_y` varchar( 100 ) NULL DEFAULT NULL, -- second part of issue information
`serialseq_z` varchar( 100 ) NULL DEFAULT NULL, -- third part of issue information
`status` tinyint(4) NOT NULL default 0, -- status code for this issue (see manual for full descriptions)
`planneddate` date default NULL, -- date expected
`notes` MEDIUMTEXT, -- notes
`publisheddate` date default NULL, -- date published
publisheddatetext varchar(100) default NULL, -- date published (descriptive)
`claimdate` date default NULL, -- date claimed
claims_count int(11) default 0, -- number of claims made related to this issue
`routingnotes` MEDIUMTEXT, -- notes from the routing list
PRIMARY KEY (`serialid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `sessions`
--
DROP TABLE IF EXISTS sessions;
CREATE TABLE sessions (
`id` varchar(32) NOT NULL,
`a_session` LONGTEXT NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `sms_providers`
--
DROP TABLE IF EXISTS sms_providers;
CREATE TABLE `sms_providers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`domain` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name` (191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Table structure for table `borrowers`
--
DROP TABLE IF EXISTS `borrowers`;
CREATE TABLE `borrowers` ( -- this table includes information about your patrons/borrowers/members
`borrowernumber` int(11) NOT NULL auto_increment, -- primary key, Koha assigned ID number for patrons/borrowers
`cardnumber` varchar(32) default NULL, -- unique key, library assigned ID number for patrons/borrowers
`surname` LONGTEXT, -- patron/borrower's last name (surname)
`firstname` MEDIUMTEXT, -- patron/borrower's first name
`title` LONGTEXT, -- patron/borrower's title, for example: Mr. or Mrs.
`othernames` LONGTEXT, -- any other names associated with the patron/borrower
`initials` MEDIUMTEXT, -- initials for your patron/borrower
`streetnumber` varchar(10) default NULL, -- the house number for your patron/borrower's primary address
`streettype` varchar(50) default NULL, -- the street type (Rd., Blvd, etc) for your patron/borrower's primary address
`address` LONGTEXT, -- the first address line for your patron/borrower's primary address
`address2` MEDIUMTEXT, -- the second address line for your patron/borrower's primary address
`city` LONGTEXT, -- the city or town for your patron/borrower's primary address
`state` MEDIUMTEXT default NULL, -- the state or province for your patron/borrower's primary address
`zipcode` varchar(25) default NULL, -- the zip or postal code for your patron/borrower's primary address
`country` MEDIUMTEXT, -- the country for your patron/borrower's primary address
`email` LONGTEXT, -- the primary email address for your patron/borrower's primary address
`phone` MEDIUMTEXT, -- the primary phone number for your patron/borrower's primary address
`mobile` varchar(50) default NULL, -- the other phone number for your patron/borrower's primary address
`fax` LONGTEXT, -- the fax number for your patron/borrower's primary address
`emailpro` MEDIUMTEXT, -- the secondary email addres for your patron/borrower's primary address
`phonepro` MEDIUMTEXT, -- the secondary phone number for your patron/borrower's primary address
`B_streetnumber` varchar(10) default NULL, -- the house number for your patron/borrower's alternate address
`B_streettype` varchar(50) default NULL, -- the street type (Rd., Blvd, etc) for your patron/borrower's alternate address
`B_address` varchar(100) default NULL, -- the first address line for your patron/borrower's alternate address
`B_address2` MEDIUMTEXT default NULL, -- the second address line for your patron/borrower's alternate address
`B_city` LONGTEXT, -- the city or town for your patron/borrower's alternate address
`B_state` MEDIUMTEXT default NULL, -- the state for your patron/borrower's alternate address
`B_zipcode` varchar(25) default NULL, -- the zip or postal code for your patron/borrower's alternate address
`B_country` MEDIUMTEXT, -- the country for your patron/borrower's alternate address
`B_email` MEDIUMTEXT, -- the patron/borrower's alternate email address
`B_phone` LONGTEXT, -- the patron/borrower's alternate phone number
`dateofbirth` date default NULL, -- the patron/borrower's date of birth (YYYY-MM-DD)
`branchcode` varchar(10) NOT NULL default '', -- foreign key from the branches table, includes the code of the patron/borrower's home branch
`categorycode` varchar(10) NOT NULL default '', -- foreign key from the categories table, includes the code of the patron category
`dateenrolled` date default NULL, -- date the patron was added to Koha (YYYY-MM-DD)
`dateexpiry` date default NULL, -- date the patron/borrower's card is set to expire (YYYY-MM-DD)
`date_renewed` date default NULL, -- date the patron/borrower's card was last renewed
`gonenoaddress` tinyint(1) default NULL, -- set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having an unconfirmed address
`lost` tinyint(1) default NULL, -- set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having lost their card
`debarred` date default NULL, -- until this date the patron can only check-in (no loans, no holds, etc.), is a fine based on days instead of money (YYYY-MM-DD)
`debarredcomment` VARCHAR(255) DEFAULT NULL, -- comment on the stop of the patron
`contactname` LONGTEXT, -- used for children and profesionals to include surname or last name of guarantor or organization name
`contactfirstname` MEDIUMTEXT, -- used for children to include first name of guarantor
`contacttitle` MEDIUMTEXT, -- used for children to include title (Mr., Mrs., etc) of guarantor
`guarantorid` int(11) default NULL, -- borrowernumber used for children or professionals to link them to guarantors or organizations