From 6abf904bffbf433b26a6da904fec2b1800274c20 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 6 Feb 2017 17:43:47 +0000 Subject: [PATCH] Bug 17960 - DBRev 16.12.00.007 Signed-off-by: Kyle M Hall --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_17960.perl | 18 ------------------ installer/data/mysql/updatedatabase.pl | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 19 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_17960.perl diff --git a/Koha.pm b/Koha.pm index 8e399d6ace..3d91ec1b6f 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 = "16.12.00.006"; +$VERSION = "16.12.00.007"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_17960.perl b/installer/data/mysql/atomicupdate/bug_17960.perl deleted file mode 100644 index 003787de21..0000000000 --- a/installer/data/mysql/atomicupdate/bug_17960.perl +++ /dev/null @@ -1,18 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - - if ( column_exists('opac_news', 'new' ) ) { - $dbh->do(q|ALTER TABLE opac_news CHANGE COLUMN new content text NOT NULL|); - } - - my ( $used_in_templates ) = $dbh->selectrow_array(q| - SELECT COUNT(*) FROM letter WHERE content LIKE "%<>%"; - |); - if ( $used_in_templates ) { - print "WARNING - It seems that you are using the opac_news.new column in your notice templates\n"; - print "Since it has now been renamed with opac_news.content, you should update them.\n"; - } - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 17960 - Rename opac_news with opac_news.content)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 0fdbded29f..5423e0724f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -13861,6 +13861,25 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "16.12.00.007"; +if( CheckVersion( $DBversion ) ) { + + if ( column_exists('opac_news', 'new' ) ) { + $dbh->do(q|ALTER TABLE opac_news CHANGE COLUMN new content text NOT NULL|); + } + + my ( $used_in_templates ) = $dbh->selectrow_array(q| + SELECT COUNT(*) FROM letter WHERE content LIKE "%<>%"; + |); + if ( $used_in_templates ) { + print "WARNING - It seems that you are using the opac_news.new column in your notice templates\n"; + print "Since it has now been renamed with opac_news.content, you should update them.\n"; + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 17960 - Rename opac_news with opac_news.content)\n"; +} + # 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