|
Lines 1421-1428
CREATE TABLE `borrowers` (
Link Here
|
| 1421 |
`B_email` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the patron/borrower''s alternate email address', |
1421 |
`B_email` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the patron/borrower''s alternate email address', |
| 1422 |
`B_phone` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the patron/borrower''s alternate phone number', |
1422 |
`B_phone` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the patron/borrower''s alternate phone number', |
| 1423 |
`dateofbirth` date DEFAULT NULL COMMENT 'the patron/borrower''s date of birth (YYYY-MM-DD)', |
1423 |
`dateofbirth` date DEFAULT NULL COMMENT 'the patron/borrower''s date of birth (YYYY-MM-DD)', |
| 1424 |
`branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'foreign key from the branches table, includes the code of the patron/borrower''s home branch', |
1424 |
`branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'foreign key from the branches table, includes the code of the patron/borrower''s home branch', |
| 1425 |
`categorycode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'foreign key from the categories table, includes the code of the patron category', |
1425 |
`categorycode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'foreign key from the categories table, includes the code of the patron category', |
| 1426 |
`dateenrolled` date DEFAULT NULL COMMENT 'date the patron was added to Koha (YYYY-MM-DD)', |
1426 |
`dateenrolled` date DEFAULT NULL COMMENT 'date the patron was added to Koha (YYYY-MM-DD)', |
| 1427 |
`dateexpiry` date DEFAULT NULL COMMENT 'date the patron/borrower''s card is set to expire (YYYY-MM-DD)', |
1427 |
`dateexpiry` date DEFAULT NULL COMMENT 'date the patron/borrower''s card is set to expire (YYYY-MM-DD)', |
| 1428 |
`password_expiration_date` date DEFAULT NULL COMMENT 'date the patron/borrower''s password is set to expire (YYYY-MM-DD)', |
1428 |
`password_expiration_date` date DEFAULT NULL COMMENT 'date the patron/borrower''s password is set to expire (YYYY-MM-DD)', |
|
Lines 1478-1485
CREATE TABLE `borrowers` (
Link Here
|
| 1478 |
KEY `firstname_idx` (`firstname`(191)), |
1478 |
KEY `firstname_idx` (`firstname`(191)), |
| 1479 |
KEY `othernames_idx` (`othernames`(191)), |
1479 |
KEY `othernames_idx` (`othernames`(191)), |
| 1480 |
KEY `sms_provider_id` (`sms_provider_id`), |
1480 |
KEY `sms_provider_id` (`sms_provider_id`), |
| 1481 |
CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`), |
1481 |
CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) ON DELETE SET NULL ON UPDATE CASCADE, |
| 1482 |
CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`), |
1482 |
CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE, |
| 1483 |
CONSTRAINT `borrowers_ibfk_3` FOREIGN KEY (`sms_provider_id`) REFERENCES `sms_providers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE |
1483 |
CONSTRAINT `borrowers_ibfk_3` FOREIGN KEY (`sms_provider_id`) REFERENCES `sms_providers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE |
| 1484 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1484 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
| 1485 |
/*!40101 SET character_set_client = @saved_cs_client */; |
1485 |
/*!40101 SET character_set_client = @saved_cs_client */; |
|
Lines 1561-1573
DROP TABLE IF EXISTS `branchtransfers`;
Link Here
|
| 1561 |
/*!40101 SET character_set_client = utf8 */; |
1561 |
/*!40101 SET character_set_client = utf8 */; |
| 1562 |
CREATE TABLE `branchtransfers` ( |
1562 |
CREATE TABLE `branchtransfers` ( |
| 1563 |
`branchtransfer_id` int(12) NOT NULL AUTO_INCREMENT COMMENT 'primary key', |
1563 |
`branchtransfer_id` int(12) NOT NULL AUTO_INCREMENT COMMENT 'primary key', |
| 1564 |
`itemnumber` int(11) NOT NULL DEFAULT 0 COMMENT 'the itemnumber that it is in transit (items.itemnumber)', |
1564 |
`itemnumber` int(11) NOT NULL COMMENT 'the itemnumber that it is in transit (items.itemnumber)', |
| 1565 |
`daterequested` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'the date the transfer was requested', |
1565 |
`daterequested` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'the date the transfer was requested', |
| 1566 |
`datesent` datetime DEFAULT NULL COMMENT 'the date the transfer was initialized', |
1566 |
`datesent` datetime DEFAULT NULL COMMENT 'the date the transfer was initialized', |
| 1567 |
`frombranch` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'the branch the transfer is coming from', |
1567 |
`frombranch` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'the branch the transfer is coming from', |
| 1568 |
`datearrived` datetime DEFAULT NULL COMMENT 'the date the transfer arrived at its destination', |
1568 |
`datearrived` datetime DEFAULT NULL COMMENT 'the date the transfer arrived at its destination', |
| 1569 |
`datecancelled` datetime DEFAULT NULL COMMENT 'the date the transfer was cancelled', |
1569 |
`datecancelled` datetime DEFAULT NULL COMMENT 'the date the transfer was cancelled', |
| 1570 |
`tobranch` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'the branch the transfer was going to', |
1570 |
`tobranch` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'the branch the transfer was going to', |
| 1571 |
`comments` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'any comments related to the transfer', |
1571 |
`comments` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'any comments related to the transfer', |
| 1572 |
`reason` ENUM('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation','Recall','RecallCancellation') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer', |
1572 |
`reason` ENUM('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation','Recall','RecallCancellation') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer', |
| 1573 |
`cancellation_reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost','WrongTransfer','CancelRecall') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer cancellation', |
1573 |
`cancellation_reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost','WrongTransfer','CancelRecall') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer cancellation', |
|
Lines 3053-3061
DROP TABLE IF EXISTS `issues`;
Link Here
|
| 3053 |
/*!40101 SET character_set_client = utf8 */; |
3053 |
/*!40101 SET character_set_client = utf8 */; |
| 3054 |
CREATE TABLE `issues` ( |
3054 |
CREATE TABLE `issues` ( |
| 3055 |
`issue_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key for issues table', |
3055 |
`issue_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key for issues table', |
| 3056 |
`borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the borrowers table for the patron this item was checked out to', |
3056 |
`borrowernumber` int(11) NOT NULL COMMENT 'foreign key, linking this to the borrowers table for the patron this item was checked out to', |
| 3057 |
`issuer_id` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the borrowers table for the user who checked out this item', |
3057 |
`issuer_id` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the borrowers table for the user who checked out this item', |
| 3058 |
`itemnumber` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the items table for the item that was checked out', |
3058 |
`itemnumber` int(11) NOT NULL COMMENT 'foreign key, linking this to the items table for the item that was checked out', |
| 3059 |
`date_due` datetime DEFAULT NULL COMMENT 'datetime the item is due (yyyy-mm-dd hh:mm::ss)', |
3059 |
`date_due` datetime DEFAULT NULL COMMENT 'datetime the item is due (yyyy-mm-dd hh:mm::ss)', |
| 3060 |
`branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out', |
3060 |
`branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out', |
| 3061 |
`returndate` datetime DEFAULT NULL COMMENT 'date the item was returned, will be NULL until moved to old_issues', |
3061 |
`returndate` datetime DEFAULT NULL COMMENT 'date the item was returned, will be NULL until moved to old_issues', |
|
Lines 3077-3084
CREATE TABLE `issues` (
Link Here
|
| 3077 |
KEY `branchcode_idx` (`branchcode`), |
3077 |
KEY `branchcode_idx` (`branchcode`), |
| 3078 |
KEY `bordate` (`borrowernumber`,`timestamp`), |
3078 |
KEY `bordate` (`borrowernumber`,`timestamp`), |
| 3079 |
KEY `issues_ibfk_borrowers_borrowernumber` (`issuer_id`), |
3079 |
KEY `issues_ibfk_borrowers_borrowernumber` (`issuer_id`), |
| 3080 |
CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON UPDATE CASCADE, |
3080 |
CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, |
| 3081 |
CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON UPDATE CASCADE, |
3081 |
CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, |
| 3082 |
CONSTRAINT `issues_ibfk_borrowers_borrowernumber` FOREIGN KEY (`issuer_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE |
3082 |
CONSTRAINT `issues_ibfk_borrowers_borrowernumber` FOREIGN KEY (`issuer_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE |
| 3083 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
3083 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
| 3084 |
/*!40101 SET character_set_client = @saved_cs_client */; |
3084 |
/*!40101 SET character_set_client = @saved_cs_client */; |
|
Lines 3951-3957
DROP TABLE IF EXISTS `old_issues`;
Link Here
|
| 3951 |
/*!40101 SET @saved_cs_client = @@character_set_client */; |
3951 |
/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 3952 |
/*!40101 SET character_set_client = utf8 */; |
3952 |
/*!40101 SET character_set_client = utf8 */; |
| 3953 |
CREATE TABLE `old_issues` ( |
3953 |
CREATE TABLE `old_issues` ( |
| 3954 |
`issue_id` int(11) NOT NULL COMMENT 'primary key for issues table', |
3954 |
`issue_id` int(11) DEFAULT NULL COMMENT 'primary key for issues table', |
| 3955 |
`borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the borrowers table for the patron this item was checked out to', |
3955 |
`borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the borrowers table for the patron this item was checked out to', |
| 3956 |
`issuer_id` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the borrowers table for the user who checked out this item', |
3956 |
`issuer_id` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the borrowers table for the user who checked out this item', |
| 3957 |
`itemnumber` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the items table for the item that was checked out', |
3957 |
`itemnumber` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the items table for the item that was checked out', |