@@ -, +, @@ --------- -- it is currently 16.00004 as of this writing -- bottom of red warnings should be the check messages. -- $VERSION message, which we don't care about -- maybe a message about return value of print ignored. --- .../mysql/atomicupdate/bug_17809_pretty_red.perl | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_17809_pretty_red.perl --- a/installer/data/mysql/atomicupdate/bug_17809_pretty_red.perl +++ a/installer/data/mysql/atomicupdate/bug_17809_pretty_red.perl @@ -0,0 +1,50 @@ +#!/usr/bin/perl -w + +use Modern::Perl; +use Carp; +use Koha::Database; + +$DBversion = 'XXX'; +if ( CheckVersion($DBversion) ) { + my $schema = Koha::Database->schema; + $schema->storage->txn_begin; + + my $number_er = $schema->resultset('AuthorisedValue')->search( + { + authorised_value => 'ER' + } + )->count; + if ( $number_er > 1 ) { + carp + 'Check for correct Germany [DE] and Eritrea [ER] authorised values.'; + } + my $number_cc = $schema->resultset('AuthorisedValue')->search( + { + authorised_value => 'CC' + } + )->count; + if ( $number_cc > 1 ) { + carp +'Check for duplicate authorised values of Cocos (Keeling) Islands [CC].'; + } + my $number_gq = $schema->resultset('AuthorisedValue')->search( + { + authorised_value => 'GQ' + } + )->count; + if ( $number_gq > 1 ) { + carp 'Check for duplicate authorised values of Equatorial Guinea [GQ].'; + } + my $number_pk = $schema->resultset('AuthorisedValue')->search( + { + authorised_value => 'PK' + } + )->count; + if ( $number_pk > 1 ) { + carp +'Check if the authorized value for Poland [PL] matches Pakistan\'s [PK].'; + } + SetVersion($DBversion); + print +"Upgrade to $DBversion done (Bug 17809 - Correct some authorised values in fr-FR)\n"; +} --