Lines 1618-1624
DROP TABLE IF EXISTS `issues`;
Link Here
|
1618 |
CREATE TABLE `issues` ( -- information related to check outs or issues |
1618 |
CREATE TABLE `issues` ( -- information related to check outs or issues |
1619 |
`issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table |
1619 |
`issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table |
1620 |
`borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to |
1620 |
`borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to |
1621 |
`issuer` int(11) default NULL, -- foreign key, linking this to the borrowers table for the user who checked out this item |
1621 |
`issuer_id` INT(11) NULL DEFAULT NULL, -- foreign key, linking this to the borrowers table for the user who checked out this item |
1622 |
`itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out |
1622 |
`itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out |
1623 |
`date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss) |
1623 |
`date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss) |
1624 |
`branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out |
1624 |
`branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out |
Lines 1641-1647
CREATE TABLE `issues` ( -- information related to check outs or issues
Link Here
|
1641 |
KEY `bordate` (`borrowernumber`,`timestamp`), |
1641 |
KEY `bordate` (`borrowernumber`,`timestamp`), |
1642 |
CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE RESTRICT ON UPDATE CASCADE, |
1642 |
CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE RESTRICT ON UPDATE CASCADE, |
1643 |
CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE RESTRICT ON UPDATE CASCADE, |
1643 |
CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE RESTRICT ON UPDATE CASCADE, |
1644 |
CONSTRAINT `issues_ibfk_borrowers_borrowernumber` FOREIGN KEY (`issuer`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE |
1644 |
CONSTRAINT `issues_ibfk_borrowers_borrowernumber` FOREIGN KEY (`issuer_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE |
1645 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1645 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1646 |
|
1646 |
|
1647 |
-- |
1647 |
-- |
Lines 1652-1658
DROP TABLE IF EXISTS `old_issues`;
Link Here
|
1652 |
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned |
1652 |
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned |
1653 |
`issue_id` int(11) NOT NULL, -- primary key for issues table |
1653 |
`issue_id` int(11) NOT NULL, -- primary key for issues table |
1654 |
`borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to |
1654 |
`borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to |
1655 |
`issuer` int(11) default NULL, -- foreign key, linking this to the borrowers table for the user who checked out this item |
1655 |
`issuer_id` INT(11) NULL DEFAULT NULL, -- foreign key, linking this to the borrowers table for the user who checked out this item |
1656 |
`itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out |
1656 |
`itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out |
1657 |
`date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd) |
1657 |
`date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd) |
1658 |
`branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out |
1658 |
`branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out |
Lines 1676-1682
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r
Link Here
|
1676 |
ON DELETE SET NULL ON UPDATE SET NULL, |
1676 |
ON DELETE SET NULL ON UPDATE SET NULL, |
1677 |
CONSTRAINT `old_issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) |
1677 |
CONSTRAINT `old_issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) |
1678 |
ON DELETE SET NULL ON UPDATE SET NULL, |
1678 |
ON DELETE SET NULL ON UPDATE SET NULL, |
1679 |
CONSTRAINT `old_issues_ibfk_borrowers_borrowernumber` FOREIGN KEY (`issuer`) REFERENCES `borrowers` (`borrowernumber`) |
1679 |
CONSTRAINT `old_issues_ibfk_borrowers_borrowernumber` FOREIGN KEY (`issuer_id`) REFERENCES `borrowers` (`borrowernumber`) |
1680 |
ON DELETE SET NULL ON UPDATE CASCADE |
1680 |
ON DELETE SET NULL ON UPDATE CASCADE |
1681 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1681 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1682 |
|
1682 |
|
1683 |
- |
|
|