Bug 32721: Atomic update fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomás Cohen Arazi 2023-10-19 15:36:59 -03:00
parent 96cac12e1d
commit d822253071
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -1,25 +1,33 @@
use Modern::Perl;
return {
bug_number => "32721",
bug_number => "32721",
description => "Allow branch specific javascript and css to be injected into the OPAC depending on a branchcode",
up => sub {
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
my ( $dbh, $out ) = @$args{qw(dbh out)};
if( !column_exists( 'branches', 'opacuserjs' ) ) {
$dbh->do(q{
ALTER TABLE branches ADD COLUMN `opacuserjs` longtext DEFAULT NULL AFTER `public`
});
if ( !column_exists( 'branches', 'opacuserjs' ) ) {
$dbh->do(
q{
ALTER TABLE branches
ADD COLUMN `opacuserjs` longtext DEFAULT NULL COMMENT 'branch specific javascript for the OPAC'
AFTER `public`
}
);
say $out "Added column 'branches.opacuserjs'";
say $out "Added column 'branches.opacuserjs'";
}
if( !column_exists( 'branches', 'opacusercss' ) ) {
$dbh->do(q{
ALTER TABLE branches ADD COLUMN `opacusercss` longtext DEFAULT NULL AFTER `opacuserjs`
});
if ( !column_exists( 'branches', 'opacusercss' ) ) {
$dbh->do(
q{
ALTER TABLE branches
ADD COLUMN `opacusercss` longtext DEFAULT NULL COMMENT 'branch specific css for the OPAC'
AFTER `opacuserjs`
}
);
say $out "Added column 'branches.opacusercss'";
say $out "Added column 'branches.opacusercss'";
}
},
};