Koha/installer/data/mysql/db_revs/221200013.pl
Marcel de Rooy 788363e416
Bug 32057: (follow-up) Add INSERT IGNORE in dbrev
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>
2023-03-14 10:55:26 -03:00

24 lines
907 B
Perl
Executable file

use Modern::Perl;
return {
bug_number => "32057",
description => "Bug 32057 - Add optional stack trace to action logs",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
if ( !column_exists( 'action_logs', 'trace' ) ) {
$dbh->do(q{
ALTER TABLE action_logs
ADD COLUMN `trace` TEXT DEFAULT NULL COMMENT 'An optional stack trace enabled by ActionLogsTraceDepth' AFTER `script`
});
say $out "Added column 'action_logs.trace'";
}
$dbh->do(q{
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'";
},
};