Bug 2720: (follow-up) add foreign key from new table to borrowers

Foreign keys should be added as a matter of course for new tables.

Argubably, borrower_debarments.manager_id could also be linked to
borrowers, but this patch does not do that.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Galen Charlton 2013-10-31 01:28:09 +00:00
parent 965b2c7d58
commit eff4815991
1 changed files with 3 additions and 1 deletions

View File

@ -7608,7 +7608,9 @@ CREATE TABLE borrower_debarments (
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
updated timestamp NULL DEFAULT NULL,
PRIMARY KEY (borrower_debarment_id),
KEY borrowernumber (borrowernumber)
KEY borrowernumber (borrowernumber) ,
CONSTRAINT `borrower_debarments_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
});