Bug 6716 - Issues Table Documentation
authorNicole C. Engard <nengard@bywatersolutions.com>
Sun, 14 Aug 2011 21:42:41 +0000 (17:42 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Mon, 12 Sep 2011 20:54:50 +0000 (08:54 +1200)
This patch documents the issues and old_issues tables.  Two fields in
both tables are left undocumented - issuingbranch and return - because
I was unable to determine what data should be stored in these fields,
they are always NULL on my install. Feel free to edit with accurate
information.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Merge conflict fixed

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
installer/data/mysql/kohastructure.sql

index 156fe60..f8b3c71 100644 (file)
@@ -942,19 +942,18 @@ CREATE TABLE `import_items` (
 --
 
 DROP TABLE IF EXISTS `issues`;
-CREATE TABLE `issues` (
-  `borrowernumber` int(11),
-  `itemnumber` int(11),
-  `date_due` date default NULL,
-  `branchcode` varchar(10) default NULL,
+CREATE TABLE `issues` ( -- information related to check outs or issues
+  `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to
+  `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out
+  `date_due` date default NULL, -- date the item is due (yyyy-mm-dd)
+  `branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out
   `issuingbranch` varchar(18) default NULL,
-  `returndate` date default NULL,
-  `lastreneweddate` date default NULL,
+  `returndate` date default NULL, -- date the item was returned, will be NULL until moved to old_issues
+  `lastreneweddate` date default NULL, -- date the item was last renewed
   `return` varchar(4) default NULL,
-  `renewals` tinyint(4) default NULL,
-  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
-  `issuedate` date default NULL,
-  PRIMARY KEY (`itemnumber`),
+  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
+  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
+  `issuedate` date default NULL, -- date the item was checked out or issued
   KEY `issuesborridx` (`borrowernumber`),
   KEY `bordate` (`borrowernumber`,`timestamp`),
   CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE RESTRICT ON UPDATE CASCADE,
@@ -1343,18 +1342,18 @@ CREATE TABLE `nozebra` (
 --
 
 DROP TABLE IF EXISTS `old_issues`;
-CREATE TABLE `old_issues` (
-  `borrowernumber` int(11) default NULL,
-  `itemnumber` int(11) default NULL,
-  `date_due` date default NULL,
-  `branchcode` varchar(10) default NULL,
+CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
+  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
+  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
+  `date_due` date default NULL, -- date the item is due (yyyy-mm-dd)
+  `branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out
   `issuingbranch` varchar(18) default NULL,
-  `returndate` date default NULL,
-  `lastreneweddate` date default NULL,
+  `returndate` date default NULL, -- date the item was returned
+  `lastreneweddate` date default NULL, -- date the item was last renewed
   `return` varchar(4) default NULL,
-  `renewals` tinyint(4) default NULL,
-  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
-  `issuedate` date default NULL,
+  `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
+  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
+  `issuedate` date default NULL, -- date the item was checked out or issued
   KEY `old_issuesborridx` (`borrowernumber`),
   KEY `old_issuesitemidx` (`itemnumber`),
   KEY `old_bordate` (`borrowernumber`,`timestamp`),