From d822253071d850777e03cae9bcfe055a6a946e7b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 19 Oct 2023 15:36:59 -0300 Subject: [PATCH] Bug 32721: Atomic update fixes Signed-off-by: Tomas Cohen Arazi --- .../bug_32721-add_branch_level_js.pl | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl b/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl index d2dddd44c2..593be7c422 100755 --- a/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl +++ b/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl @@ -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'"; } }, }; -- 2.39.5