@@ -, +, @@ --- installer/data/mysql/db_revs/210600012.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/installer/data/mysql/db_revs/210600012.pl +++ a/installer/data/mysql/db_revs/210600012.pl @@ -8,6 +8,18 @@ return { my $dbh = $args->{dbh}; if( !unique_key_exists( 'language_subtag_registry', 'uniq_lang' ) ) { + $dbh->do(q{ + DELETE a + FROM language_subtag_registry a + WHERE id IN ( + SELECT id FROM ( + SELECT MIN(id) AS id + FROM language_subtag_registry b + GROUP BY subtag, type + HAVING COUNT(*) > 1 + ) c + ); + }); $dbh->do(q{ ALTER TABLE language_subtag_registry ADD UNIQUE KEY uniq_lang (subtag, type) --