--
DROP TABLE IF EXISTS `itemtypes`;
-CREATE TABLE `itemtypes` (
- `itemtype` varchar(10) NOT NULL default '',
- `description` mediumtext,
- `rentalcharge` double(16,4) default NULL,
- `notforloan` smallint(6) default NULL,
- `imageurl` varchar(200) default NULL,
- `summary` text,
+CREATE TABLE `itemtypes` ( -- defines the item types
+ `itemtype` varchar(10) NOT NULL default '', -- unique key, a code associated with the item type
+ `description` mediumtext, -- a plain text explanation of the item type
+ `rentalcharge` double(16,4) default NULL, -- the amount charged when this item is checked out/issued
+ `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` text, -- information from the summary field, may include HTML
PRIMARY KEY (`itemtype`),
UNIQUE KEY `itemtype` (`itemtype`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
DROP TABLE IF EXISTS `letter`;
-CREATE TABLE `letter` (
- `module` varchar(20) NOT NULL default '',
- `code` varchar(20) NOT NULL default '',
- `name` varchar(100) NOT NULL default '',
- `title` varchar(200) NOT NULL default '',
- `content` text,
+CREATE TABLE `letter` ( -- table for all notice templates in Koha
+ `module` varchar(20) NOT NULL default '', -- Koha module that triggers this notice
+ `code` varchar(20) NOT NULL default '', -- unique identifier for this notice
+ `name` varchar(100) NOT NULL default '', -- plain text name for this notice
+ `title` varchar(200) NOT NULL default '', -- subject line of the notice
+ `content` text, -- body text for the notice
PRIMARY KEY (`module`,`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
DROP TABLE IF EXISTS `opac_news`;
-CREATE TABLE `opac_news` (
- `idnew` int(10) unsigned NOT NULL auto_increment,
- `title` varchar(250) NOT NULL default '',
- `new` text NOT NULL,
- `lang` varchar(25) NOT NULL default '',
- `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
- `expirationdate` date default NULL,
- `number` int(11) default NULL,
+CREATE TABLE `opac_news` ( -- data from the news tool
+ `idnew` int(10) unsigned NOT NULL auto_increment, -- unique identifier for the news article
+ `title` varchar(250) NOT NULL default '', -- title of the news article
+ `new` text NOT NULL, -- the body of your news article
+ `lang` varchar(25) NOT NULL default '', -- location for the article (koha is the staff client, slip is the circulation receipt and language codes are for the opac)
+ `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- pulibcation date and time
+ `expirationdate` date default NULL, -- date the article is set to expire or no longer be visible
+ `number` int(11) default NULL, -- the order in which this article appears in that specific location
PRIMARY KEY (`idnew`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
DROP TABLE IF EXISTS `overduerules`;
-CREATE TABLE `overduerules` (
- `branchcode` varchar(10) NOT NULL default '',
- `categorycode` varchar(10) NOT NULL default '',
- `delay1` int(4) default NULL,
- `letter1` varchar(20) default NULL,
- `debarred1` varchar(1) default 0,
- `delay2` int(4) default NULL,
- `debarred2` varchar(1) default 0,
- `letter2` varchar(20) default NULL,
- `delay3` int(4) default NULL,
- `letter3` varchar(20) default NULL,
- `debarred3` int(1) default 0,
+CREATE TABLE `overduerules` ( -- overdue notice status and triggers
+ `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 (`branchcode`,`categorycode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
DROP TABLE IF EXISTS `reviews`;
-CREATE TABLE `reviews` (
- `reviewid` int(11) NOT NULL auto_increment,
- `borrowernumber` int(11) default NULL,
- `biblionumber` int(11) default NULL,
- `review` text,
- `approved` tinyint(4) default NULL,
- `datereviewed` datetime default NULL,
+CREATE TABLE `reviews` ( -- patron opac comments
+ `reviewid` int(11) NOT NULL auto_increment, -- unique identifier for this comment
+ `borrowernumber` int(11) default NULL, -- foreign key from the borrowers table defining which patron left this comment
+ `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bibliographic record this comment is for
+ `review` text, -- the body of the comment
+ `approved` tinyint(4) default NULL, -- whether this comment has been approved by a librarian (1 for yes, 0 for no)
+ `datereviewed` datetime default NULL, -- the date the comment was left
PRIMARY KEY (`reviewid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
DROP TABLE IF EXISTS `roadtype`;
-CREATE TABLE `roadtype` (
- `roadtypeid` int(11) NOT NULL auto_increment,
- `road_type` varchar(100) NOT NULL default '',
+CREATE TABLE `roadtype` ( -- road types defined in administration and used in patron management
+ `roadtypeid` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha for each road type
+ `road_type` varchar(100) NOT NULL default '', -- text for road type
PRIMARY KEY (`roadtypeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
DROP TABLE IF EXISTS `systempreferences`;
-CREATE TABLE `systempreferences` (
- `variable` varchar(50) NOT NULL default '',
- `value` text,
- `options` mediumtext,
- `explanation` text,
- `type` varchar(20) default NULL,
+CREATE TABLE `systempreferences` ( -- global system preferences
+ `variable` varchar(50) NOT NULL default '', -- system preference name
+ `value` text, -- system preference values
+ `options` mediumtext, -- options for multiple choice system preferences
+ `explanation` text, -- descriptive text for the system preference
+ `type` varchar(20) default NULL, -- type of question this preference asks (multiple choice, plain text, yes or no, etc)
PRIMARY KEY (`variable`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;