From 03f160cba988be2ee0d18c67bbad2f7303926cc0 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 19 Sep 2023 16:19:45 -0300 Subject: [PATCH] Bug 27634: DBRev 23.06.00.020 Signed-off-by: Tomas Cohen Arazi --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_27634.perl | 20 ------------- installer/data/mysql/db_revs/230600020.pl | 29 +++++++++++++++++++ 3 files changed, 30 insertions(+), 21 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_27634.perl create mode 100755 installer/data/mysql/db_revs/230600020.pl diff --git a/Koha.pm b/Koha.pm index 05e0c3ed41..d65afd7c92 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.019"; +$VERSION = "23.06.00.020"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_27634.perl b/installer/data/mysql/atomicupdate/bug_27634.perl deleted file mode 100644 index b3c2d943d7..0000000000 --- a/installer/data/mysql/atomicupdate/bug_27634.perl +++ /dev/null @@ -1,20 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - - for my $f ( qw( categorycode dateexpiry ) ) { - my ( $exists ) = $dbh->selectrow_array(qq{ - SELECT value from systempreferences - WHERE variable="PatronSelfRegistrationBorrowerUnwantedField" - AND value LIKE "%$f%" - }); - unless ( $exists ) { - $dbh->do(q{ - UPDATE systempreferences - SET value = CONCAT(value, IF(value<>'','|',''), ?) - WHERE variable="PatronSelfRegistrationBorrowerUnwantedField" - }, undef, $f); - } - } - - NewVersion( $DBversion, 27634, "Add categorycode and dateexpiry to PatronSelfRegistrationBorrowerUnwantedField"); -} diff --git a/installer/data/mysql/db_revs/230600020.pl b/installer/data/mysql/db_revs/230600020.pl new file mode 100755 index 0000000000..c899c353cd --- /dev/null +++ b/installer/data/mysql/db_revs/230600020.pl @@ -0,0 +1,29 @@ +use Modern::Perl; + +return { + bug_number => "27634", + description => "Add categorycode and dateexpiry to PatronSelfRegistrationBorrowerUnwantedField", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + for my $f (qw( categorycode dateexpiry )) { + my ($exists) = $dbh->selectrow_array( + qq{ + SELECT value from systempreferences + WHERE variable="PatronSelfRegistrationBorrowerUnwantedField" + AND value LIKE "%$f%" + } + ); + unless ($exists) { + $dbh->do( + q{ + UPDATE systempreferences + SET value = CONCAT(value, IF(value<>'','|',''), ?) + WHERE variable="PatronSelfRegistrationBorrowerUnwantedField" + }, undef, $f + ); + } + } + }, +}; -- 2.39.5