Bug 29778: Prevent orphan additional contents
[koha.git] / installer / data / mysql / atomicupdate / bug_29778.pl
1 use Modern::Perl;
2
3 return {
4     bug_number => "29778",
5     description => "Delete orphan additional contents",
6     up => sub {
7         my ($args) = @_;
8         my ($dbh, $out) = @$args{qw(dbh out)};
9         $dbh->do(q{
10             DELETE FROM additional_contents
11             WHERE code NOT IN (
12                 SELECT code
13                 FROM additional_contents
14                 WHERE lang = "default"
15             );
16         });
17     },
18 }