Koha/installer/data/mysql/db_revs/220600045.pl
Tomas Cohen Arazi b56a874a16
Bug 29144: DBRev 22.06.00.045
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-16 10:25:07 -03:00

23 lines
772 B
Perl
Executable file

use Modern::Perl;
return {
bug_number => 29144,
description => "Copy and remove branches.opac_info",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
if ( column_exists( 'branches', 'opac_info' ) ) {
$dbh->do(q{
INSERT IGNORE INTO additional_contents ( category,code,location,branchcode,title,content,lang,published_on )
SELECT 'html_customizations', CONCAT('OpacLibraryInfo_', branches.branchcode), 'OpacLibraryInfo', branches.branchcode, branches.branchname, branches.opac_info, 'default', NOW()
FROM branches
WHERE branches.opac_info IS NOT NULL
});
$dbh->do(q{
ALTER TABLE branches DROP COLUMN opac_info;
});
}
},
};