[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
Tue Apr 7 13:50:28 CEST 2020
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22887
--- Comment #22 from Lari Taskula <lari.taskula at hypernova.fi> ---
(In reply to Jonathan Druart from comment #20)
> (In reply to Lari Taskula from comment #15)
> > Comment on attachment 101890 [details] [review] [review]
> > Bug 22887: Warn if duplicates exist
> >
> > Review of attachment 101890 [details] [review] [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.
Indeed deleting can be a bit nasty and unfair. Then what about stopping
updatedatabase.pl with die() until the sysadmin fixes the problem?
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list