[Koha-bugs] [Bug 7065] reserves table needs a primary key

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sun Jun 10 18:38:41 CEST 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7065

Paul Poulain <paul.poulain at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Passed QA                   |Failed QA

--- Comment #23 from Paul Poulain <paul.poulain at biblibre.com> ---
Failed QA, and a tricky one !!!

When tmp_reserve is created, it is from reserves, so with 
borrowernumber being NOT NULL default 0

When old_reserves is copied to tmp_reserves ... all NULL borrowernumbers are
transformed to 0 ... and when it's copied back to old_reserves ... booom,
contraint failed:

[Sun Jun 10 18:28:14 2012] updatedatabase.pl: DBD::mysql::db do failed: Cannot
add or update a child row: a foreign key constraint fails
(`lecannetdesmaures`.`old_reserves`, CONSTRAINT `old_reserves_ibfk_1` FOREIGN
KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET
NULL ON UPDATE SET NULL) at
/home/paul/koha.dev/koha-community/installer/data/mysql/updatedatabase.pl line
5395.


That's a common situation to have NULL in old_reserves, when a borrower is
removed from the database but we want to keep the history of the hold "someone
placed a hold on yyyy-mm-dd"

I think the solution would be to have tmp_reserve be created from old_reserve,
to enable the NULL field !

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list