From d0a37bb8bfdb8f426f83920314179b207be496fd Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 21 Apr 2017 14:03:42 -0400 Subject: [PATCH] Bug 18427 - DBRev 16.12.00.026 Signed-off-by: Kyle M Hall --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug18427.perl | 17 ----------------- installer/data/mysql/updatedatabase.pl | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug18427.perl diff --git a/Koha.pm b/Koha.pm index 65e1c10ee5..efcd4feea2 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.025"; +$VERSION = "16.12.00.026"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug18427.perl b/installer/data/mysql/atomicupdate/bug18427.perl deleted file mode 100644 index a77a9486d2..0000000000 --- a/installer/data/mysql/atomicupdate/bug18427.perl +++ /dev/null @@ -1,17 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - - # In order to be overcomplete, we check if the situation is what we expect - if( !index_exists( 'serialitems', 'PRIMARY' ) ) { - if( index_exists( 'serialitems', 'serialitemsidx' ) ) { - $dbh->do(q| -ALTER TABLE serialitems ADD PRIMARY KEY (itemnumber), DROP INDEX serialitemsidx; - |); - } else { - $dbh->do(q|ALTER TABLE serialitems ADD PRIMARY KEY (itemnumber)|); - } - } - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 18427 - Add a primary key to serialitems)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6abc32b529..a1ea65d3e2 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14134,6 +14134,24 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 17669 - Introduce preference for deleting temporary uploads)\n"; } +$DBversion = '16.12.00.026'; +if( CheckVersion( $DBversion ) ) { + + # In order to be overcomplete, we check if the situation is what we expect + if( !index_exists( 'serialitems', 'PRIMARY' ) ) { + if( index_exists( 'serialitems', 'serialitemsidx' ) ) { + $dbh->do(q| + ALTER TABLE serialitems ADD PRIMARY KEY (itemnumber), DROP INDEX serialitemsidx; + |); + } else { + $dbh->do(q|ALTER TABLE serialitems ADD PRIMARY KEY (itemnumber)|); + } + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 18427 - Add a primary key to serialitems)\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