Bug 18801: [Follow-up] Dbrev to repair bad auth type codes
Test plan Run updatedatabase. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
c1112236f9
commit
aa03981e79
1 changed files with 15 additions and 0 deletions
15
installer/data/mysql/atomicupdate/bug18801.perl
Normal file
15
installer/data/mysql/atomicupdate/bug18801.perl
Normal file
|
@ -0,0 +1,15 @@
|
|||
$DBversion = 'XXX'; # will be replaced by the RM
|
||||
if( CheckVersion( $DBversion ) ) {
|
||||
# Fetch all auth types
|
||||
my $authtypes = $dbh->selectcol_arrayref( q|SELECT authtypecode FROM auth_types| );
|
||||
|
||||
if( grep { $_ eq 'Default' } @$authtypes ) {
|
||||
# If this exists as an authtypecode, we don't do anything
|
||||
} else {
|
||||
# Replace the incorrect Default by empty string
|
||||
$dbh->do( q|UPDATE auth_header SET authtypecode='' WHERE authtypecode='Default'| );
|
||||
}
|
||||
|
||||
SetVersion( $DBversion );
|
||||
print "Upgrade to $DBversion done (Bug 18801 - Update incorrect Default auth type codes)\n";
|
||||
}
|
Loading…
Reference in a new issue