Lines 3301-3306
CREATE TABLE `illrequestattributes` (
Link Here
|
3301 |
CONSTRAINT `illrequestattributes_ifk` FOREIGN KEY (`illrequest_id`) REFERENCES `illrequests` (`illrequest_id`) ON DELETE CASCADE ON UPDATE CASCADE |
3301 |
CONSTRAINT `illrequestattributes_ifk` FOREIGN KEY (`illrequest_id`) REFERENCES `illrequests` (`illrequest_id`) ON DELETE CASCADE ON UPDATE CASCADE |
3302 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
3302 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
3303 |
/*!40101 SET character_set_client = @saved_cs_client */; |
3303 |
/*!40101 SET character_set_client = @saved_cs_client */; |
|
|
3304 |
-- |
3305 |
-- Table structure for table `illbatch_statuses` |
3306 |
-- |
3307 |
DROP TABLE IF EXISTS `illbatch_statuses`; |
3308 |
CREATE TABLE `illbatch_statuses` ( |
3309 |
`id` int(11) NOT NULL auto_increment, -- Status ID |
3310 |
`name` varchar(100) NOT NULL, -- Name of status |
3311 |
`code` varchar(20) NOT NULL, -- Unique, immutable code for status |
3312 |
`is_system` int(1), -- Is this status required for system operation |
3313 |
PRIMARY KEY (`id`), |
3314 |
UNIQUE KEY `u_illbatchstatuses__code` (`code`) |
3315 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
3316 |
|
3317 |
-- |
3318 |
-- Table structure for table `illbatches` |
3319 |
-- |
3320 |
DROP TABLE IF EXISTS `illbatches`; |
3321 |
CREATE TABLE `illbatches` ( |
3322 |
`id` int(11) NOT NULL auto_increment, -- Batch ID |
3323 |
`name` varchar(100) NOT NULL, -- Unique name of batch |
3324 |
`backend` varchar(20) NOT NULL, -- Name of batch backend |
3325 |
`borrowernumber` int(11), -- Patron associated with batch |
3326 |
`branchcode` varchar(50), -- Branch associated with batch |
3327 |
`statuscode` varchar(20), -- Status of batch |
3328 |
PRIMARY KEY (`id`), |
3329 |
UNIQUE KEY `u_illbatches__name` (`name`), |
3330 |
CONSTRAINT `illbatches_bnfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, |
3331 |
CONSTRAINT `illbatches_bcfk` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE, |
3332 |
CONSTRAINT `illbatches_sfk` FOREIGN KEY (`statuscode`) REFERENCES `illbatch_statuses` (`code`) ON DELETE SET NULL ON UPDATE CASCADE |
3333 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
3304 |
|
3334 |
|
3305 |
-- |
3335 |
-- |
3306 |
-- Table structure for table `illrequests` |
3336 |
-- Table structure for table `illrequests` |
Lines 3330-3335
CREATE TABLE `illrequests` (
Link Here
|
3330 |
`notesstaff` mediumtext DEFAULT NULL COMMENT 'Staff notes attached to request', |
3360 |
`notesstaff` mediumtext DEFAULT NULL COMMENT 'Staff notes attached to request', |
3331 |
`orderid` varchar(50) DEFAULT NULL COMMENT 'Backend id attached to request', |
3361 |
`orderid` varchar(50) DEFAULT NULL COMMENT 'Backend id attached to request', |
3332 |
`backend` varchar(20) DEFAULT NULL COMMENT 'The backend used to create request', |
3362 |
`backend` varchar(20) DEFAULT NULL COMMENT 'The backend used to create request', |
|
|
3363 |
`batch_id` int(11) COMMENT 'Optional ID of batch that this request belongs to', |
3333 |
PRIMARY KEY (`illrequest_id`), |
3364 |
PRIMARY KEY (`illrequest_id`), |
3334 |
KEY `illrequests_bnfk` (`borrowernumber`), |
3365 |
KEY `illrequests_bnfk` (`borrowernumber`), |
3335 |
KEY `illrequests_bcfk_2` (`branchcode`), |
3366 |
KEY `illrequests_bcfk_2` (`branchcode`), |
Lines 3338-3344
CREATE TABLE `illrequests` (
Link Here
|
3338 |
CONSTRAINT `illrequests_bcfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE, |
3369 |
CONSTRAINT `illrequests_bcfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE, |
3339 |
CONSTRAINT `illrequests_bibfk` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE, |
3370 |
CONSTRAINT `illrequests_bibfk` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE, |
3340 |
CONSTRAINT `illrequests_bnfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, |
3371 |
CONSTRAINT `illrequests_bnfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, |
3341 |
CONSTRAINT `illrequests_safk` FOREIGN KEY (`status_alias`) REFERENCES `authorised_values` (`authorised_value`) ON DELETE SET NULL ON UPDATE CASCADE |
3372 |
CONSTRAINT `illrequests_safk` FOREIGN KEY (`status_alias`) REFERENCES `authorised_values` (`authorised_value`) ON DELETE SET NULL ON UPDATE CASCADE, |
|
|
3373 |
CONSTRAINT `illrequests_ibfk` FOREIGN KEY (`batch_id`) REFERENCES `illbatches` (`id`) ON DELETE SET NULL ON UPDATE CASCADE |
3342 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
3374 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
3343 |
/*!40101 SET character_set_client = @saved_cs_client */; |
3375 |
/*!40101 SET character_set_client = @saved_cs_client */; |
3344 |
|
3376 |
|