`contactname` LONGTEXT, -- used for children and profesionals to include surname or last name of guarantor or organization name
`contactfirstname` MEDIUMTEXT, -- used for children to include first name of guarantor
`contacttitle` MEDIUMTEXT, -- used for children to include title (Mr., Mrs., etc) of guarantor
- `guarantorid` int(11) default NULL, -- borrowernumber used for children or professionals to link them to guarantors or organizations
`borrowernotes` LONGTEXT, -- a note on the patron/borrower's account that is only visible in the staff client
`relationship` varchar(100) default NULL, -- used for children to include the relationship to their guarantor
`sex` varchar(1) default NULL, -- patron/borrower's gender
`contactname` LONGTEXT, -- used for children and profesionals to include surname or last name of guarantor or organization name
`contactfirstname` MEDIUMTEXT, -- used for children to include first name of guarantor
`contacttitle` MEDIUMTEXT, -- used for children to include title (Mr., Mrs., etc) of guarantor
- `guarantorid` int(11) default NULL, -- borrowernumber used for children or professionals to link them to guarantors or organizations
`borrowernotes` LONGTEXT, -- a note on the patron/borrower's account that is only visible in the staff client
`relationship` varchar(100) default NULL, -- used for children to include the relationship to their guarantor
`sex` varchar(1) default NULL, -- patron/borrower's gender
KEY `categorycode` (`categorycode`),
KEY `branchcode` (`branchcode`),
UNIQUE KEY `userid` (`userid`),
- KEY `guarantorid` (`guarantorid`),
KEY `surname_idx` (`surname` (191)),
KEY `firstname_idx` (`firstname` (191)),
KEY `othernames_idx` (`othernames` (191)),
`contactname` LONGTEXT,
`contactfirstname` MEDIUMTEXT,
`contacttitle` MEDIUMTEXT,
- `guarantorid` int(11) DEFAULT NULL,
`borrowernotes` LONGTEXT,
`relationship` varchar(100) DEFAULT NULL,
`sex` varchar(1) DEFAULT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
+-- Table structure for table 'guarantors_guarantees'
+--
+
+DROP TABLE IF EXISTS borrower_relationships;
+CREATE TABLE `borrower_relationships` (
+ id INT(11) NOT NULL AUTO_INCREMENT,
+ guarantor_id INT(11) NULL DEFAULT NULL,
+ guarantee_id INT(11) NOT NULL,
+ relationship VARCHAR(100) NOT NULL,
+ PRIMARY KEY (id),
+ CONSTRAINT r_guarantor FOREIGN KEY ( guarantor_id ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE,
+ CONSTRAINT r_guarantee FOREIGN KEY ( guarantee_id ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+
+--
-- Table structure for table `illrequests`
--