Bug 32057: (follow-up) Add INSERT IGNORE in dbrev
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tue, 14 Mar 2023 12:30:32 +0000 (12:30 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 14 Mar 2023 13:55:26 +0000 (10:55 -0300)
Preventing:
ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry 'ActionLogsTraceDepth' for key 'PRIMARY' at /usr/share/koha/C4/Installer.pm line 739

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
installer/data/mysql/db_revs/221200013.pl

index a0cc9a7..c4c642f 100755 (executable)
@@ -16,7 +16,7 @@ return {
         }
 
         $dbh->do(q{
-            INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
+            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
             ('ActionLogsTraceDepth', '0', '', 'Sets the maximum depth of the action logs stack trace', 'Integer')
         });
         say $out "Added new system preference 'ActionLogsTraceDepth'";