From 12e83a64ececa12e691d855e2454a30a9b5e0e04 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 23 Jul 2020 10:32:09 +0200 Subject: [PATCH] Bug 5087: DBRev 20.06.00.011 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- ...d_opac_option_field_to_export_formats.perl | 19 ------------------ installer/data/mysql/updatedatabase.pl | 20 +++++++++++++++++++ 3 files changed, 21 insertions(+), 20 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_5087_-_add_opac_option_field_to_export_formats.perl diff --git a/Koha.pm b/Koha.pm index b7b3b3464e..8845b91276 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.010"; +$VERSION = "20.06.00.011"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_5087_-_add_opac_option_field_to_export_formats.perl b/installer/data/mysql/atomicupdate/bug_5087_-_add_opac_option_field_to_export_formats.perl deleted file mode 100644 index 41ee9459f4..0000000000 --- a/installer/data/mysql/atomicupdate/bug_5087_-_add_opac_option_field_to_export_formats.perl +++ /dev/null @@ -1,19 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - unless( column_exists( 'export_format', 'staff_only' ) ) { - $dbh->do(q| - ALTER TABLE export_format - ADD staff_only TINYINT(1) NOT NULL DEFAULT 0 AFTER used_for, - ADD KEY `staff_only_idx` (`staff_only`); - |); - } - - unless ( index_exists( 'export_format', 'used_for_idx' ) ) { - $dbh->do(q| - ALTER TABLE export_format - ADD KEY `used_for_idx` (`used_for` (191)); - |); - } - - NewVersion( $DBversion, 5087, "Add export_format.staff_only" ); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 348b797f92..e2877ea335 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -22356,6 +22356,26 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 20815, "Add NoRefundOnLostReturnedItemsAge system preference" ); } +$DBversion = '20.06.00.011'; +if( CheckVersion( $DBversion ) ) { + unless( column_exists( 'export_format', 'staff_only' ) ) { + $dbh->do(q| + ALTER TABLE export_format + ADD staff_only TINYINT(1) NOT NULL DEFAULT 0 AFTER used_for, + ADD KEY `staff_only_idx` (`staff_only`); + |); + } + + unless ( index_exists( 'export_format', 'used_for_idx' ) ) { + $dbh->do(q| + ALTER TABLE export_format + ADD KEY `used_for_idx` (`used_for` (191)); + |); + } + + NewVersion( $DBversion, 5087, "Add export_format.staff_only" ); +} + # 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