[Koha-bugs] [Bug 22887] authorised_values is missing a unique constraint on category + authorised_value

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Apr 6 12:09:58 CEST 2020


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

--- Comment #20 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
(In reply to Lari Taskula from comment #15)
> Comment on attachment 101890 [details] [review]
> Bug 22887: Warn if duplicates exist
> 
> Review of attachment 101890 [details] [review]:
> -----------------------------------------------------------------
> 
> ::: installer/data/mysql/atomicupdate/bug_22887.perl
> @@ +7,5 @@
> > +            GROUP BY category, authorised_value
> > +            HAVING c > 1
> > +        |, { Slice => {} });
> > +        if ( @$duplicates ) {
> > +            warn "WARNING - Cannot create unique constraint on authorised_value(category, authorised_value)\n";
> 
> Nice to give a warning. We should still make sure the constraint actually
> gets created for everyone.
> 
> Perhaps delete the duplicates and print & log what was deleted?
> 
> Or die instead of warn.

The idea is to not remove data that could be use by a fork in a different way.
I usually prefer to not remove the data, and warn, instead of remove them
and... sometimes people forgets to backup their DB... ;)
But I am not strongly attached to the approach here.

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


More information about the Koha-bugs mailing list