From 312783f8fcc6dc6be892b2a7ce641ef443de5e0c Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 22 Nov 2016 13:49:59 +0000 Subject: [PATCH] Bug 8835 - DBRev 16.06.00.050 --- Koha.pm | 2 +- installer/data/mysql/atomicupdate/8835_dbrev.perl | 23 ---------------------- installer/data/mysql/updatedatabase.pl | 24 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 24 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/8835_dbrev.perl diff --git a/Koha.pm b/Koha.pm index 60ac7340ca..c4752286ca 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.06.00.049"; +$VERSION = "16.06.00.050"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/8835_dbrev.perl b/installer/data/mysql/atomicupdate/8835_dbrev.perl deleted file mode 100644 index eee4e7585a..0000000000 --- a/installer/data/mysql/atomicupdate/8835_dbrev.perl +++ /dev/null @@ -1,23 +0,0 @@ -$DBversion = "16.06.00.XXX"; -if ( CheckVersion($DBversion) ) { - - # If index issn_idx still exists, we assume that dbrev 3.15.00.049 failed, - # and we repeat it (partially). - # Note: the db rev only pertains to biblioitems and is not needed for - # deletedbiblioitems. - - my $temp = $dbh->selectall_arrayref( "SHOW INDEXES FROM biblioitems WHERE key_name = 'issn_idx'" ); - - if( @$temp > 0 ) { - $dbh->do( "ALTER TABLE biblioitems DROP INDEX isbn" ); - $dbh->do( "ALTER TABLE biblioitems DROP INDEX issn" ); - $dbh->do( "ALTER TABLE biblioitems DROP INDEX issn_idx" ); - $dbh->do( "ALTER TABLE biblioitems CHANGE isbn isbn MEDIUMTEXT NULL DEFAULT NULL, CHANGE issn issn MEDIUMTEXT NULL DEFAULT NULL" ); - $dbh->do( "ALTER TABLE biblioitems ADD INDEX isbn ( isbn ( 255 ) ), ADD INDEX issn ( issn ( 255 ) )" ); - print "Upgrade to $DBversion done (Bug 8835). Removed issn_idx.\n"; - } else { - print "Upgrade to $DBversion done (Bug 8835). Everything is fine.\n"; - } - - SetVersion($DBversion); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index fbb9a51193..e07693a5dc 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -13663,6 +13663,30 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 17391 - ReturnpathDefault and ReplyToDefault missing from syspref.sql)\n"; } +$DBversion = "16.06.00.050"; +if ( CheckVersion($DBversion) ) { + + # If index issn_idx still exists, we assume that dbrev 3.15.00.049 failed, + # and we repeat it (partially). + # Note: the db rev only pertains to biblioitems and is not needed for + # deletedbiblioitems. + + my $temp = $dbh->selectall_arrayref( "SHOW INDEXES FROM biblioitems WHERE key_name = 'issn_idx'" ); + + if( @$temp > 0 ) { + $dbh->do( "ALTER TABLE biblioitems DROP INDEX isbn" ); + $dbh->do( "ALTER TABLE biblioitems DROP INDEX issn" ); + $dbh->do( "ALTER TABLE biblioitems DROP INDEX issn_idx" ); + $dbh->do( "ALTER TABLE biblioitems CHANGE isbn isbn MEDIUMTEXT NULL DEFAULT NULL, CHANGE issn issn MEDIUMTEXT NULL DEFAULT NULL" ); + $dbh->do( "ALTER TABLE biblioitems ADD INDEX isbn ( isbn ( 255 ) ), ADD INDEX issn ( issn ( 255 ) )" ); + print "Upgrade to $DBversion done (Bug 8835). Removed issn_idx.\n"; + } else { + print "Upgrade to $DBversion done (Bug 8835). Everything is fine.\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.11.4.GIT