From 799293c40fc4419b9df9ea941836778c2e359684 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 9 Oct 2017 14:24:31 -0300 Subject: [PATCH] Bug 13766: DBRev 17.06.00.011 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- .../mysql/atomicupdate/bug_13766_fix_ean.perl | 21 ------------------ installer/data/mysql/updatedatabase.pl | 22 +++++++++++++++++++ 3 files changed, 23 insertions(+), 22 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_13766_fix_ean.perl diff --git a/Koha.pm b/Koha.pm index c8a5290472..272e194c56 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 = "17.06.00.010"; +$VERSION = "17.06.00.011"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_13766_fix_ean.perl b/installer/data/mysql/atomicupdate/bug_13766_fix_ean.perl deleted file mode 100644 index 21d1fc1639..0000000000 --- a/installer/data/mysql/atomicupdate/bug_13766_fix_ean.perl +++ /dev/null @@ -1,21 +0,0 @@ -$DBversion = "XXX"; -if(CheckVersion($DBversion)) { - # Drop index that might exist because of bug 5337 - if( index_exists('biblioitems', 'ean')) { - $dbh->do(q{ ALTER TABLE biblioitems DROP INDEX ean }); - } - if( index_exists('deletedbiblioitems', 'ean')) { - $dbh->do(q{ ALTER TABLE deletedbiblioitems DROP INDEX ean }); - } - - # Change data type of column - $dbh->do(q{ ALTER TABLE biblioitems MODIFY COLUMN ean MEDIUMTEXT default NULL }); - $dbh->do(q{ ALTER TABLE deletedbiblioitems MODIFY COLUMN ean MEDIUMTEXT default NULL }); - - # Add indexes - $dbh->do(q{ ALTER TABLE biblioitems ADD INDEX ean ( ean(255) )}); - $dbh->do(q{ ALTER TABLE deletedbiblioitems ADD INDEX ean ( ean(255 ) )}); - - print "Upgrade to $DBversion done (Bug 13766 - Make ean mediumtext and add ean indexes)\n"; - SetVersion($DBversion); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index ea42dabc42..17eb074320 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14686,6 +14686,28 @@ if ( CheckVersion($DBversion) ) { print "Upgrade to $DBversion done (Bug 13912 - System preference for default place of publication (country code) for field 008, range 15-17)\n"; } +$DBversion = '17.06.00.011'; +if ( CheckVersion($DBversion) ) { + # Drop index that might exist because of bug 5337 + if( index_exists('biblioitems', 'ean')) { + $dbh->do(q{ ALTER TABLE biblioitems DROP INDEX ean }); + } + if( index_exists('deletedbiblioitems', 'ean')) { + $dbh->do(q{ ALTER TABLE deletedbiblioitems DROP INDEX ean }); + } + + # Change data type of column + $dbh->do(q{ ALTER TABLE biblioitems MODIFY COLUMN ean MEDIUMTEXT default NULL }); + $dbh->do(q{ ALTER TABLE deletedbiblioitems MODIFY COLUMN ean MEDIUMTEXT default NULL }); + + # Add indexes + $dbh->do(q{ ALTER TABLE biblioitems ADD INDEX ean ( ean(255) )}); + $dbh->do(q{ ALTER TABLE deletedbiblioitems ADD INDEX ean ( ean(255 ) )}); + + SetVersion($DBversion); + print "Upgrade to $DBversion done (Bug 13766 - Make ean mediumtext and add ean indexes)\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