From dc9b62f8fdf8afde4c4986ce9993c0590ca09bae Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 14 May 2020 21:49:28 +0000 Subject: [PATCH] Bug 23081: DBRev 19.05.10.002 Signed-off-by: Lucas Gass --- Koha.pm | 2 +- .../bug_23081-change-default-of-issues-field.perl | 15 --------------- installer/data/mysql/updatedatabase.pl | 10 ++++++++++ 3 files changed, 11 insertions(+), 16 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_23081-change-default-of-issues-field.perl diff --git a/Koha.pm b/Koha.pm index 48546f3aa8..44e8a7779d 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 = "19.05.10.001"; +$VERSION = "19.05.10.002"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_23081-change-default-of-issues-field.perl b/installer/data/mysql/atomicupdate/bug_23081-change-default-of-issues-field.perl deleted file mode 100644 index 204d9999b3..0000000000 --- a/installer/data/mysql/atomicupdate/bug_23081-change-default-of-issues-field.perl +++ /dev/null @@ -1,15 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - # you can use $dbh here like: - $dbh->do( "UPDATE items set issues=0 where issues is null" ); - $dbh->do( "UPDATE deleteditems set issues=0 where issues is null" ); - $dbh->do( "ALTER TABLE items ALTER issues set default 0" ); - $dbh->do( "ALTER TABLE deleteditems ALTER issues set default 0" ); - # or perform some test and warn - # if( !column_exists( 'biblio', 'biblionumber' ) ) { - # warn "There is something wrong"; - # } - - # Always end with this (adjust the bug info) - NewVersion( $DBversion, 23081, "Set default to 0 for items.issues"); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index f5ea5bc74b..c0254e8bf0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -19041,6 +19041,16 @@ WHERE a.id < b.id AND a.borrowernumber IS NOT NULL AND a.borrowernumber=b.borrow print "Upgrade to $DBversion done (Bug 20754: Remove double accepted list shares)\n"; } +$DBversion = '19.05.10.002'; +if( CheckVersion( $DBversion ) ) { + $dbh->do( "UPDATE items set issues=0 where issues is null" ); + $dbh->do( "UPDATE deleteditems set issues=0 where issues is null" ); + $dbh->do( "ALTER TABLE items ALTER issues set default 0" ); + $dbh->do( "ALTER TABLE deleteditems ALTER issues set default 0" ); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 23081: Set default to 0 for items.issues)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5