[Koha-patches] [PATCH] bug_4002: issues referential integrity

Galen Charlton gmcharlt at gmail.com
Wed Apr 13 23:47:54 CEST 2011


Hi,

On Wed, Apr 13, 2011 at 1:17 AM, Srdjan Jankovic <srdjan at catalyst.net.nz> wrote:
> +    $dbh->do("DELETE FROM issues WHERE NOT EXISTS (SELECT * FROM borrowers WHERE borrowernumber = issues.borrowernumber)");
> +    $dbh->do("DELETE FROM issues WHERE NOT EXISTS (SELECT * FROM items WHERE itemnumber = issues.itemnumber)");

Since there is a decent chance that such rows used to refer to actual
loans and might have value for statistical purposes, they ought to be
moved to old_issues before being deleted.

Regards,

Galen
-- 
Galen Charlton
gmcharlt at gmail.com


More information about the Koha-patches mailing list