From ed6228de83dc57e624c3b3dc30632775df972277 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 25 Apr 2019 10:36:36 +0000 Subject: [PATCH] Bug 22339: DBRev 18.12.00.062 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_22339.perl | 55 ------------------ installer/data/mysql/updatedatabase.pl | 56 +++++++++++++++++++ 3 files changed, 57 insertions(+), 56 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_22339.perl diff --git a/Koha.pm b/Koha.pm index 153229dba5..41b814b6a9 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 = "18.12.00.061"; +$VERSION = "18.12.00.062"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_22339.perl b/installer/data/mysql/atomicupdate/bug_22339.perl deleted file mode 100644 index 187e936c74..0000000000 --- a/installer/data/mysql/atomicupdate/bug_22339.perl +++ /dev/null @@ -1,55 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - $dbh->do( q| - UPDATE search_marc_map SET marc_field='007_/0' - WHERE marc_type IN ('marc21', 'normarc') AND marc_field='007_/1' AND id IN - (SELECT search_marc_map_id FROM search_marc_to_field WHERE search_field_id IN - (SELECT id FROM search_field WHERE label='ff7-00') - ) - |); - - $dbh->do( q| - UPDATE search_marc_map SET marc_field='007_/1' - WHERE marc_type IN ('marc21', 'normarc') AND marc_field='007_/2' AND id IN - (SELECT search_marc_map_id FROM search_marc_to_field WHERE search_field_id IN - (SELECT id FROM search_field WHERE label='ff7-01') - ) - |); - - $dbh->do( q| - UPDATE search_marc_map SET marc_field='007_/2' - WHERE marc_type IN ('marc21', 'normarc') AND marc_field='007_/3' AND id IN - (SELECT search_marc_map_id FROM search_marc_to_field WHERE search_field_id IN - (SELECT id FROM search_field WHERE label='ff7-02') - ) - |); - - # N.B. ff7-01-02 really is 00-01! - $dbh->do( q| - UPDATE search_marc_map SET marc_field='007_/0-1' - WHERE marc_type IN ('marc21', 'normarc') AND marc_field='007_/1-2' AND id IN - (SELECT search_marc_map_id FROM search_marc_to_field WHERE search_field_id IN - (SELECT id FROM search_field WHERE label='ff7-01-02') - ) - |); - - $dbh->do( q| - UPDATE search_marc_map SET marc_field='008_/0-5' - WHERE marc_type IN ('marc21', 'normarc') AND marc_field='008_/1-5' AND id IN - (SELECT search_marc_map_id FROM search_marc_to_field WHERE search_field_id IN - (SELECT id FROM search_field WHERE label='date-entered-on-file') - ) - |); - - $dbh->do( q| - UPDATE search_marc_map SET marc_field='leader_/0-4' - WHERE marc_type IN ('marc21', 'normarc') AND marc_field='leader_/1-5' AND id IN - (SELECT search_marc_map_id FROM search_marc_to_field WHERE search_field_id IN - (SELECT id FROM search_field WHERE label='llength') - ) - |); - - # Always end with this (adjust the bug info) - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 22339 - Fix search field mappings of MARC fixed fields)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 42f223abd2..3bc127dcce 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -18281,6 +18281,62 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 21336 - (follow-up) Rename flgAnonymized column)\n"; } +$DBversion = '18.12.00.062'; +if( CheckVersion( $DBversion ) ) { + $dbh->do( q| + UPDATE search_marc_map SET marc_field='007_/0' + WHERE marc_type IN ('marc21', 'normarc') AND marc_field='007_/1' AND id IN + (SELECT search_marc_map_id FROM search_marc_to_field WHERE search_field_id IN + (SELECT id FROM search_field WHERE label='ff7-00') + ) + |); + + $dbh->do( q| + UPDATE search_marc_map SET marc_field='007_/1' + WHERE marc_type IN ('marc21', 'normarc') AND marc_field='007_/2' AND id IN + (SELECT search_marc_map_id FROM search_marc_to_field WHERE search_field_id IN + (SELECT id FROM search_field WHERE label='ff7-01') + ) + |); + + $dbh->do( q| + UPDATE search_marc_map SET marc_field='007_/2' + WHERE marc_type IN ('marc21', 'normarc') AND marc_field='007_/3' AND id IN + (SELECT search_marc_map_id FROM search_marc_to_field WHERE search_field_id IN + (SELECT id FROM search_field WHERE label='ff7-02') + ) + |); + + # N.B. ff7-01-02 really is 00-01! + $dbh->do( q| + UPDATE search_marc_map SET marc_field='007_/0-1' + WHERE marc_type IN ('marc21', 'normarc') AND marc_field='007_/1-2' AND id IN + (SELECT search_marc_map_id FROM search_marc_to_field WHERE search_field_id IN + (SELECT id FROM search_field WHERE label='ff7-01-02') + ) + |); + + $dbh->do( q| + UPDATE search_marc_map SET marc_field='008_/0-5' + WHERE marc_type IN ('marc21', 'normarc') AND marc_field='008_/1-5' AND id IN + (SELECT search_marc_map_id FROM search_marc_to_field WHERE search_field_id IN + (SELECT id FROM search_field WHERE label='date-entered-on-file') + ) + |); + + $dbh->do( q| + UPDATE search_marc_map SET marc_field='leader_/0-4' + WHERE marc_type IN ('marc21', 'normarc') AND marc_field='leader_/1-5' AND id IN + (SELECT search_marc_map_id FROM search_marc_to_field WHERE search_field_id IN + (SELECT id FROM search_field WHERE label='llength') + ) + |); + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 22339 - Fix search field mappings of MARC fixed fields)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5