From 032661643622d31297145bcc143b8a8f6808ab79 Mon Sep 17 00:00:00 2001 From: Brendan Gallagher Date: Fri, 29 Apr 2016 02:26:46 +0000 Subject: [PATCH] Bug 16217: Update DB rev (3.22.06.001) Signed-off-by: Julian Maurice --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_16217.perl | 14 ------------ installer/data/mysql/updatedatabase.pl | 22 +++++++++++++++++++ 3 files changed, 23 insertions(+), 15 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_16217.perl diff --git a/Koha.pm b/Koha.pm index 96c37e6ddb..781d086b89 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 = "3.22.06.000"; +$VERSION = "3.22.06.001"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_16217.perl b/installer/data/mysql/atomicupdate/bug_16217.perl deleted file mode 100644 index a58e799e76..0000000000 --- a/installer/data/mysql/atomicupdate/bug_16217.perl +++ /dev/null @@ -1,14 +0,0 @@ -my $dbh = C4::Context->dbh; -my $letters = $dbh->selectall_arrayref(q| - SELECT code, name - FROM letter - WHERE message_transport_type="email" -|, { Slice => {} }); -for my $letter ( @$letters ) { - $dbh->do(q| - UPDATE letter - SET name = ? - WHERE code = ? - AND message_transport_type <> "email" - |, undef, $letter->{name}, $letter->{code}); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 110c2c6c02..3a4b2802c0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -11524,6 +11524,28 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.22.06.001"; +if ( CheckVersion($DBversion) ) { + my $letters = $dbh->selectall_arrayref(q| + SELECT code, name + FROM letter + WHERE message_transport_type="email" + |, { Slice => {} }); + + for my $letter ( @$letters ) { + $dbh->do(q| + UPDATE letter + SET name = ? + WHERE code = ? + AND message_transport_type <> "email" + |, undef, $letter->{name}, $letter->{code}); + } + + print "Upgrade to $DBversion done (Bug 16217 - Notice' names may have diverged)\n"; + SetVersion($DBversion); +} + + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5