Lines 1144-1150
CREATE TABLE `issues` ( -- information related to check outs or issues
Link Here
|
1144 |
`itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out |
1144 |
`itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out |
1145 |
`date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss) |
1145 |
`date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss) |
1146 |
`branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out |
1146 |
`branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out |
1147 |
`issuingbranch` varchar(18) default NULL, |
|
|
1148 |
`returndate` datetime default NULL, -- date the item was returned, will be NULL until moved to old_issues |
1147 |
`returndate` datetime default NULL, -- date the item was returned, will be NULL until moved to old_issues |
1149 |
`lastreneweddate` datetime default NULL, -- date the item was last renewed |
1148 |
`lastreneweddate` datetime default NULL, -- date the item was last renewed |
1150 |
`return` varchar(4) default NULL, |
1149 |
`return` varchar(4) default NULL, |
Lines 1156-1162
CREATE TABLE `issues` ( -- information related to check outs or issues
Link Here
|
1156 |
KEY `issuesborridx` (`borrowernumber`), |
1155 |
KEY `issuesborridx` (`borrowernumber`), |
1157 |
KEY `itemnumber_idx` (`itemnumber`), |
1156 |
KEY `itemnumber_idx` (`itemnumber`), |
1158 |
KEY `branchcode_idx` (`branchcode`), |
1157 |
KEY `branchcode_idx` (`branchcode`), |
1159 |
KEY `issuingbranch_idx` (`issuingbranch`), |
|
|
1160 |
KEY `bordate` (`borrowernumber`,`timestamp`), |
1158 |
KEY `bordate` (`borrowernumber`,`timestamp`), |
1161 |
CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE RESTRICT ON UPDATE CASCADE, |
1159 |
CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE RESTRICT ON UPDATE CASCADE, |
1162 |
CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE RESTRICT ON UPDATE CASCADE |
1160 |
CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE RESTRICT ON UPDATE CASCADE |
Lines 1618-1624
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r
Link Here
|
1618 |
`itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out |
1616 |
`itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out |
1619 |
`date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd) |
1617 |
`date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd) |
1620 |
`branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out |
1618 |
`branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out |
1621 |
`issuingbranch` varchar(18) default NULL, |
|
|
1622 |
`returndate` datetime default NULL, -- date the item was returned |
1619 |
`returndate` datetime default NULL, -- date the item was returned |
1623 |
`lastreneweddate` datetime default NULL, -- date the item was last renewed |
1620 |
`lastreneweddate` datetime default NULL, -- date the item was last renewed |
1624 |
`return` varchar(4) default NULL, |
1621 |
`return` varchar(4) default NULL, |
Lines 1630-1636
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r
Link Here
|
1630 |
KEY `old_issuesborridx` (`borrowernumber`), |
1627 |
KEY `old_issuesborridx` (`borrowernumber`), |
1631 |
KEY `old_issuesitemidx` (`itemnumber`), |
1628 |
KEY `old_issuesitemidx` (`itemnumber`), |
1632 |
KEY `branchcode_idx` (`branchcode`), |
1629 |
KEY `branchcode_idx` (`branchcode`), |
1633 |
KEY `issuingbranch_idx` (`issuingbranch`), |
|
|
1634 |
KEY `old_bordate` (`borrowernumber`,`timestamp`), |
1630 |
KEY `old_bordate` (`borrowernumber`,`timestamp`), |
1635 |
CONSTRAINT `old_issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) |
1631 |
CONSTRAINT `old_issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) |
1636 |
ON DELETE SET NULL ON UPDATE SET NULL, |
1632 |
ON DELETE SET NULL ON UPDATE SET NULL, |