From 8c92eda71933421ceac596bda7c1601314c72841 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 31 Aug 2020 14:05:05 +0000 Subject: [PATCH] Bug 22789: DBRev 20.06.00.031 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_22789.perl | 17 ----------------- installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ 3 files changed, 15 insertions(+), 18 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_22789.perl diff --git a/Koha.pm b/Koha.pm index cfee2627e8..10e7548ef2 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 = "20.06.00.030"; +$VERSION = "20.06.00.031"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_22789.perl b/installer/data/mysql/atomicupdate/bug_22789.perl deleted file mode 100644 index eb75263f66..0000000000 --- a/installer/data/mysql/atomicupdate/bug_22789.perl +++ /dev/null @@ -1,17 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - # you can use $dbh here like: - # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" ); - - # or perform some test and warn - if( !column_exists( 'reserves', 'non_priority' ) ) { - $dbh->do("ALTER TABLE reserves ADD COLUMN `non_priority` tinyint(1) NOT NULL DEFAULT 0 AFTER `item_level_hold` -- Is this a non priority hold"); - } - - if( !column_exists( 'old_reserves', 'non_priority' ) ) { - $dbh->do("ALTER TABLE old_reserves ADD COLUMN `non_priority` tinyint(1) NOT NULL DEFAULT 0 AFTER `item_level_hold` -- Is this a non priority hold"); - } - - # Always end with this (adjust the bug info) - NewVersion( $DBversion, 22789, "Add non_priority column on reserves and old_reserves tables"); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index ee5930442a..ff05ba3085 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -22689,6 +22689,20 @@ if ( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 20057, "Add new system preference 'AutoApprovePatronProfileSettings'"); } +$DBversion = '20.06.00.031'; +if( CheckVersion( $DBversion ) ) { + + if( !column_exists( 'reserves', 'non_priority' ) ) { + $dbh->do("ALTER TABLE reserves ADD COLUMN `non_priority` tinyint(1) NOT NULL DEFAULT 0 AFTER `item_level_hold`"); + } + + if( !column_exists( 'old_reserves', 'non_priority' ) ) { + $dbh->do("ALTER TABLE old_reserves ADD COLUMN `non_priority` tinyint(1) NOT NULL DEFAULT 0 AFTER `item_level_hold`"); + } + + NewVersion( $DBversion, 22789, "Add non_priority column on reserves and old_reserves tables"); +} + # 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