Bug 11175: (follow-up) make atomic update idempotent

Atomic update tries to insert line into system preferences even if it's
already there. This patch fixes that by adding 'IGNORE' to the query,
making it idempotent.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Nugged <nugged@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Petro Vashchuk 2021-04-27 12:50:56 +03:00 committed by Jonathan Druart
parent 3ffe2477cf
commit 5e34b9d6db
1 changed files with 1 additions and 1 deletions

View File

@ -1,6 +1,6 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
$dbh->do("INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('ShowComponentRecords', 'nowhere', 'nowhere|staff|opac|both','In which record detail pages to show list of the component records, as linked via 773','Choice')");
$dbh->do("INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('ShowComponentRecords', 'nowhere', 'nowhere|staff|opac|both','In which record detail pages to show list of the component records, as linked via 773','Choice')");
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 11175: Show component records in detail views)\n";
}