DB upgrade 18.06.00.005 from Bug 12395 can fail : BD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`koha`.`aqorders`, CONSTRAINT `aqorders_created_by` FOREIGN KEY (`created_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE) [for Statement "UPDATE aqorders, aqbasket SET aqorders.created_by = aqbasket.authorisedby WHERE aqorders.basketno = aqbasket.basketno AND aqorders.created_by IS NULL;"] at ./installer/data/mysql/updatedatabase.pl line 16131. This upgrade adds a constraint on aqorders.created_by linked to borrowers.borrowernumber. Then copies aqbasket.authorisedby into aqorders.created_by. But aqbasket.authorisedby as no constraint so its value may not be an existing borrowernumber (deleted borrower).
Correct manually with : update aqbasket left join borrowers on (aqbasket.authorisedby = borrowers.borrowernumber) set aqbasket.authorisedby = NULL where borrowers.borrowernumber is null;
Created attachment 87535 [details] [review] Bug 22642: Corrections to updatedatebase for bug 12395 Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 87552 [details] [review] Bug 22642: Corrections to updatedatebase for bug 12395 Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Confused
Sorry Martin, I just wanted to check with you before I REALLY DOUBLE COMMITTED to this SO, I was confused about the version but we have worked ourselves out. Back to SO it goes!
Created attachment 87774 [details] [review] Bug 22642: Corrections to updatedatebase for bug 12395 Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.05
missing dependency, won't backport to 18.05.x series
Too late for installs that upgraded already?