[Koha-bugs] [Bug 22368] Table suggestions lacks foreign key constraints

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Feb 25 07:44:35 CET 2019


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

--- Comment #30 from Josef Moravec <josef.moravec at gmail.com> ---
(In reply to Katrin Fischer from comment #28)
> (In reply to Martin Renvoize from comment #27)
> > (In reply to Jonathan Druart from comment #24)
> > > Regarding C4::Biblio::DelBiblio, suggestions_ibfk_biblionumber should ON
> > > DELETE CASCADE (instead of SET NULL).
> > > Same for suggestions_ibfk_branchcode?
> > > 
> > > Marking as FQA/In discussion
> > 
> > I did wonder about these too... I was hoping to spark such discussion with
> > the submission of this bug, so thanks.
> > 
> > I'm happy to agree that 'deleting a biblio should also delete any
> > suggestions attached to it' and 'deleting a branch should also delete any
> > suggestions attached'.. Josef do you concur/have any opinion?
> 
> I think I'd prefer NULL in both cases as suggestions are perfectly fine
> without a branch and a biblionumber, both are optional right now.
> 
> Deleting library:
> Should be a really rare case. I think at the moment we warn if there are
> patrons and items for the library before deleting. Should this be extended
> to cover suggestions as well? 
> I think I'd prefer resetting to NULL (any library) to deleting. It seems the
> less dangerous and a patron from another library could have made the
> suggestion to begin with (or anonymous) and another library still might want
> to process it or inform the patron.
> 
> Deleting biblio:
> This one is harder, I think I like NULL better, because the suggestion
> doesn't need the link, it's optional as it's only added when the suggestion
> is ordered.
> A use case where this might happen is: A patron makes a suggestion, it's
> ordered, it's 'sold out' and the order is cancelled deleting the record
> along with it. You might want to reset the status of the suggestion and try
> another vendor or inform the patron.
> 
> I might think about this from the wrong direction, but maybe it adds to the
> discussion :)

I do prefer to SET NULL on both, as Katrin said, somebody can reuse it then...
for example deleting it after deleting order and biblio is a side effect from
my point of view - we are not working with suggestions and some suggestion can
be deleted, even without a notice - it is weird.

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


More information about the Koha-bugs mailing list