[Koha-bugs] [Bug 13518] Table borrower_modifications is missing FK and not deleted with the patron

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 17 11:25:07 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13518

--- Comment #5 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 103130
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=103130&action=edit
Bug 13518: Delete patron's modifications along with the patron

The table borrower_modifications has no FK constraint on the borrowernumber
and will remain untouched when the patron is deleted.
If the borrowernumber doesn't exist in the database, the modification entry is
no longer visible in Koha.

The problem is that this table is used for the borrower modifications and the
self-registration features.

So far borrowernumber is the PK (int(11) NOT NULL DEFAULT '0'), for the
self-registration feature we can have borrowernumber that is not defined (0 is
used)

Ideally we would like to have borrowernumber a DEFAULT NULL, and use NULL for
self-reg, but then we will loose the PK (PK cannot be NULL).

As we cannot keep the correct constraints at DB level anyway, we will need to
handle consistency at code-level.

Test plan:
Create a new patron
Do some modification at the OPAC
Delete the patron
Confirm that the modifications as been removed (directly in DB)

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list