From 93c0f4420d22a510d56dd04bf11fad6b413e657c Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 27 Apr 2020 11:34:29 +0100 Subject: [PATCH] Bug 23081: DBRev 19.12.00.080 Signed-off-by: Martin Renvoize --- 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 14025c60c9..1641e5ba17 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.12.00.079"; +$VERSION = "19.12.00.080"; 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 def5093852..42bb38b9ae 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -21853,6 +21853,16 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 25045, "Add a way to restrict anonymous access to public routes (OpacPublic behaviour)"); } +$DBversion = '19.12.00.080'; +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" ); + + NewVersion( $DBversion, 23081, "Set default to 0 for items.issues"); +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5