Bug 34328: Make update idempotent
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Perltidied the atomic update.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1dd482bb8e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
09df56991a
commit
a6fcce30f9
|
|
@ -6,45 +6,65 @@ return {
|
|||
up => sub {
|
||||
my ($args) = @_;
|
||||
my ( $dbh, $out ) = @$args{qw(dbh out)};
|
||||
$dbh->do(q{
|
||||
INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
|
||||
|
||||
# Unique key on subtag + code.. use INSERT IGNORE
|
||||
$dbh->do(
|
||||
q{
|
||||
INSERT IGNORE INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code)
|
||||
VALUES ( 'gd','gla' )
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
$dbh->do(q{
|
||||
INSERT INTO language_subtag_registry( subtag, type, description, added)
|
||||
# Unique key on subtag + type.. use INSERT IGNORE
|
||||
$dbh->do(
|
||||
q{
|
||||
INSERT IGNORE INTO language_subtag_registry( subtag, type, description, added)
|
||||
VALUES ( 'gd', 'language', 'Scottish Gaelic', NOW() )
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
$dbh->do(q{
|
||||
INSERT INTO language_descriptions(subtag, type, lang, description)
|
||||
# Unique key on subtag + type + lang.. use INSERT IGNORE
|
||||
$dbh->do(
|
||||
q{
|
||||
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)
|
||||
$dbh->do(
|
||||
q{
|
||||
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)
|
||||
$dbh->do(
|
||||
q{
|
||||
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)
|
||||
$dbh->do(
|
||||
q{
|
||||
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)
|
||||
$dbh->do(
|
||||
q{
|
||||
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)
|
||||
$dbh->do(
|
||||
q{
|
||||
INSERT IGNORE INTO language_descriptions(subtag, type, lang, description)
|
||||
VALUES ( 'gd', 'language', 'pl', 'Język szkocki gaelicki')
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
say $out "Added new language 'Scottish Gaelic'";
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue