[Koha-bugs] [Bug 21674] Data integrity not enforced for library groups

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jan 23 12:43:58 CET 2020


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

--- Comment #9 from Nick Clemens <nick at bywatersolutions.com> ---
(In reply to Jonathan Druart from comment #8)
> (In reply to Jonathan Druart from comment #7)
> > Created attachment 97667 [details] [review] [review]
> > Bug 21674: Remove duplicates from library_groups before adding the uniq
> > constraint
> > 
> > To avoid to make it fails if duplicates existed prior to this change
> 
> There is certainly a more efficient (SQL) way to do that.

DELETE FROM library_groups WHERE id NOT IN (SELECT MIN(id) FROM library_groups
WHERE parent_id IS NOT NULL GROUP BY parent_id,branchcode) AND parent_id IS NOT
NULL;

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


More information about the Koha-bugs mailing list