From 66d7b49bfa4fae3131823892bf9156ac2b0336f4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 1 Mar 2021 14:10:39 +0000 Subject: [PATCH] Bug 27316: DBRev 20.11.03.003 Signed-off-by: Jonathan Druart (cherry picked from commit 482d77b536ed89b9c6b354ab50dfb4a86fa472ca) Signed-off-by: Fridolin Somers --- Koha.pm | 2 +- .../mysql/atomicupdate/bug_23716_update_sort_mappings.perl | 6 ------ installer/data/mysql/updatedatabase.pl | 7 +++++++ 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_23716_update_sort_mappings.perl diff --git a/Koha.pm b/Koha.pm index 16761f378c..74df5f5541 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.11.03.002"; +$VERSION = "20.11.03.003"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_23716_update_sort_mappings.perl b/installer/data/mysql/atomicupdate/bug_23716_update_sort_mappings.perl deleted file mode 100644 index b1c41bc065..0000000000 --- a/installer/data/mysql/atomicupdate/bug_23716_update_sort_mappings.perl +++ /dev/null @@ -1,6 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - $dbh->do( "UPDATE search_marc_to_field SET sort = 1 WHERE sort IS NULL" ); - $dbh->do( "ALTER TABLE search_marc_to_field MODIFY COLUMN sort tinyint(1) DEFAULT 1 NOT NULL COMMENT 'Sort defaults to 1 (Yes) and creates sort fields in the index, 0 (no) will prevent this'" ); - NewVersion( $DBversion, 27316, "In Elastisearch mappings convert NULL (Undef) for sort to 1 (Yes)"); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 40044e122e..3eca463c62 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -23477,6 +23477,13 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 7806, "Remove remaining possible 0000-00-00 values"); } +$DBversion = '20.11.03.003'; +if( CheckVersion( $DBversion ) ) { + $dbh->do( "UPDATE search_marc_to_field SET sort = 1 WHERE sort IS NULL" ); + $dbh->do( "ALTER TABLE search_marc_to_field MODIFY COLUMN sort tinyint(1) DEFAULT 1 NOT NULL COMMENT 'Sort defaults to 1 (Yes) and creates sort fields in the index, 0 (no) will prevent this'" ); + NewVersion( $DBversion, 27316, "In Elastisearch mappings convert NULL (Undef) for sort to 1 (Yes)"); +} + # 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