Koha/installer/data/mysql/db_revs/211200005.pl
Jonathan Druart 3bd3db0e12 Bug 31383: Fix the DB upgrade process
This patch fixes misc4dev/run_tests.pl --run-db-upgrade-only

We need to make sure the column exists before running the query.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2023-10-21 08:17:10 +02:00

23 lines
684 B
Perl
Executable file

use Modern::Perl;
return {
bug_number => "29778",
description => "Delete orphan additional contents",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
# Run this only if 230600041 has not been run before
if ( column_exists('additional_contents', 'lang') ) {
$dbh->do(q{
DELETE FROM additional_contents
WHERE code NOT IN (
SELECT code FROM (
SELECT code
FROM additional_contents
WHERE lang = "default"
) as tmp
);
});
}
},
}