]> git.koha-community.org Git - koha.git/commit
Bug 29631: Prevent uniq_lang creation to fail
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 3 Dec 2021 13:33:41 +0000 (14:33 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 14 Dec 2021 01:46:20 +0000 (15:46 -1000)
commit9c2929a3513b4178ba2a9e783e3bca3054a80a03
tree54f0a6c5a104868c234e42949ea10c96d19928f7
parent1eb6a02c2f1265cef30788f141efd527eaff58d5
Bug 29631: Prevent uniq_lang creation to fail

We got 2 reports of this problem in the last 24h, uniq_lang unique key is failing to be created because several rows with the same (subtag, type) exist in DB.

I have no idea how this is possible, but apparently it is.

Test plan:
Checkout a commit before 21.06.00.012
reset_all
Create duplicate in language_subtag_registry
> insert into language_subtag_registry(subtag, type, description) values('IN', 'region', 'India');
Checkout master+this patch, updatedatabase
=> Only 1 IN-region exists in the DB, the last one.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
installer/data/mysql/db_revs/210600012.pl