Lines 1576-1581
CREATE TABLE `borrower_attributes` ( -- values of custom patron fields known as
Link Here
|
1576 |
ON DELETE CASCADE ON UPDATE CASCADE |
1576 |
ON DELETE CASCADE ON UPDATE CASCADE |
1577 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1577 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1578 |
|
1578 |
|
|
|
1579 |
DROP TABLE IF EXISTS `debarment_types`; |
1580 |
CREATE TABLE debarment_types ( |
1581 |
code varchar(50) NOT NULL PRIMARY KEY, |
1582 |
display_text text NOT NULL, |
1583 |
ronly tinyint(1) NOT NULL DEFAULT 0, |
1584 |
dflt tinyint(1) NOT NULL DEFAULT 0 |
1585 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1586 |
|
1579 |
-- |
1587 |
-- |
1580 |
-- Table structure for table `borrower_debarments` |
1588 |
-- Table structure for table `borrower_debarments` |
1581 |
-- |
1589 |
-- |
Lines 1585-1591
CREATE TABLE borrower_debarments ( -- tracks restrictions on the patron's record
Link Here
|
1585 |
borrower_debarment_id int(11) NOT NULL AUTO_INCREMENT, -- unique key for the restriction |
1593 |
borrower_debarment_id int(11) NOT NULL AUTO_INCREMENT, -- unique key for the restriction |
1586 |
borrowernumber int(11) NOT NULL, -- foreign key for borrowers.borrowernumber for patron who is restricted |
1594 |
borrowernumber int(11) NOT NULL, -- foreign key for borrowers.borrowernumber for patron who is restricted |
1587 |
expiration date DEFAULT NULL, -- expiration date of the restriction |
1595 |
expiration date DEFAULT NULL, -- expiration date of the restriction |
1588 |
`type` enum('SUSPENSION','OVERDUES','MANUAL','DISCHARGE') NOT NULL DEFAULT 'MANUAL', -- type of restriction |
1596 |
`type` varchar(50) NOT NULL, -- type of restriction, FK to debarment_types.code |
1589 |
`comment` MEDIUMTEXT, -- comments about the restriction |
1597 |
`comment` MEDIUMTEXT, -- comments about the restriction |
1590 |
manager_id int(11) DEFAULT NULL, -- foreign key for borrowers.borrowernumber for the librarian managing the restriction |
1598 |
manager_id int(11) DEFAULT NULL, -- foreign key for borrowers.borrowernumber for the librarian managing the restriction |
1591 |
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- date the restriction was added |
1599 |
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- date the restriction was added |
Lines 1593-1599
CREATE TABLE borrower_debarments ( -- tracks restrictions on the patron's record
Link Here
|
1593 |
PRIMARY KEY (borrower_debarment_id), |
1601 |
PRIMARY KEY (borrower_debarment_id), |
1594 |
KEY borrowernumber (borrowernumber), |
1602 |
KEY borrowernumber (borrowernumber), |
1595 |
CONSTRAINT `borrower_debarments_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) |
1603 |
CONSTRAINT `borrower_debarments_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) |
1596 |
ON DELETE CASCADE ON UPDATE CASCADE |
1604 |
ON DELETE CASCADE ON UPDATE CASCADE, |
|
|
1605 |
CONSTRAINT `borrower_debarments_ibfk_2` FOREIGN KEY (`type`) REFERENCES `debarment_types` (`code`) |
1606 |
ON DELETE NO ACTION ON UPDATE CASCADE |
1597 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1607 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
1598 |
|
1608 |
|
1599 |
-- |
1609 |
-- |
1600 |
- |
|
|