From 8a099dc4884497ea220a409daf86aed99b5605a0 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 23 Oct 2023 11:28:02 -0300 Subject: [PATCH] Bug 33547: DBRev 23.06.00.046 Signed-off-by: Tomas Cohen Arazi --- Koha.pm | 2 +- .../bug_33547.pl => db_revs/230600046.pl} | 21 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) rename installer/data/mysql/{atomicupdate/bug_33547.pl => db_revs/230600046.pl} (77%) diff --git a/Koha.pm b/Koha.pm index d6a64595c9..ab9cfbb542 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "23.06.00.045"; +$VERSION = "23.06.00.046"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_33547.pl b/installer/data/mysql/db_revs/230600046.pl similarity index 77% rename from installer/data/mysql/atomicupdate/bug_33547.pl rename to installer/data/mysql/db_revs/230600046.pl index dafd77ab88..15d50ee4db 100755 --- a/installer/data/mysql/atomicupdate/bug_33547.pl +++ b/installer/data/mysql/db_revs/230600046.pl @@ -1,17 +1,19 @@ use Modern::Perl; return { - bug_number => "33547", + bug_number => "33547", description => "Add a new notice template 'PRES_TRAIN_ITEM'", - up => sub { + up => sub { my ($args) = @_; - my ($dbh, $out) = @$args{qw(dbh out)}; + my ( $dbh, $out ) = @$args{qw(dbh out)}; - unless ( column_exists('preservation_processings', 'letter_code') ) { - $dbh->do(q{ + unless ( column_exists( 'preservation_processings', 'letter_code' ) ) { + $dbh->do( + q{ ALTER TABLE preservation_processings ADD COLUMN `letter_code` varchar(20) DEFAULT NULL COMMENT 'Foreign key to the letters table' AFTER `name` - }); + } + ); } my $notice_template = q{[%~ USE AuthorisedValues ~%] @@ -32,11 +34,14 @@ Item number #[% train_item.user_train_item_id %] [% item_attribute.processing_attribute.name %]: [% value %] [% END %]}; - $dbh->do(q{ + $dbh->do( + q{ INSERT IGNORE INTO letter (module,code,branchcode,name,is_html,title,content,message_transport_type,lang) VALUES - ('preservation','PRES_TRAIN_ITEM','','Train item slip',0,'Train item slip',?, 'print','default')}, undef, $notice_template); + ('preservation','PRES_TRAIN_ITEM','','Train item slip',0,'Train item slip',?, 'print','default')}, undef, + $notice_template + ); say $out "Added new letter 'PRES_TRAIN_ITEM' (print)"; }, }; -- 2.39.5