From 7f273a316c7ab2dab928777302b42462edc55c94 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 6 Oct 2023 10:41:20 +0100 Subject: [PATCH] Bug 34328: Make update idempotent --- .../data/mysql/atomicupdate/bug_34328.pl | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_34328.pl b/installer/data/mysql/atomicupdate/bug_34328.pl index 5fbf7cdee2f..de73f5af105 100755 --- a/installer/data/mysql/atomicupdate/bug_34328.pl +++ b/installer/data/mysql/atomicupdate/bug_34328.pl @@ -6,43 +6,47 @@ return { up => sub { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Unique key on subtag + code.. use INSERT IGNORE $dbh->do(q{ - INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) + INSERT IGNORE INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES ( 'gd','gla' ) }); + # Unique key on subtag + type.. use INSERT IGNORE $dbh->do(q{ - INSERT INTO language_subtag_registry( subtag, type, description, added) + INSERT IGNORE INTO language_subtag_registry( subtag, type, description, added) VALUES ( 'gd', 'language', 'Scottish Gaelic', NOW() ) }); + # Unique key on subtag + type + lang.. use INSERT IGNORE $dbh->do(q{ - INSERT INTO language_descriptions(subtag, type, lang, description) + INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES ( 'gd', 'language', 'en', 'Scottish Gaelic') }); $dbh->do(q{ - INSERT INTO language_descriptions(subtag, type, lang, description) + INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES ( 'gd', 'language', 'en_GB', 'Scottish Gaelic') }); $dbh->do(q{ - INSERT INTO language_descriptions(subtag, type, lang, description) + INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES ( 'gd', 'language', 'gd', 'Gàidhlig') }); $dbh->do(q{ - INSERT INTO language_descriptions(subtag, type, lang, description) + INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES ( 'gd', 'language', 'fr', 'Gaélique écossais') }); $dbh->do(q{ - INSERT INTO language_descriptions(subtag, type, lang, description) + INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES ( 'gd', 'language', 'de', 'Schottisch-Gälisch') }); $dbh->do(q{ - INSERT INTO language_descriptions(subtag, type, lang, description) + INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES ( 'gd', 'language', 'pl', 'Język szkocki gaelicki') }); -- 2.41.0