From eff4815991e03e6b73bd29bd6385d9fc521bfcaf Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 31 Oct 2013 01:28:09 +0000 Subject: [PATCH] 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 --- installer/data/mysql/updatedatabase.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 78ef75fa63..6c351d2005 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -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; }); -- 2.39.5