Bug 18801: DBRev 17.05.00.003

This commit is contained in:
Jonathan Druart 2017-07-06 14:28:18 -03:00
parent aa03981e79
commit 83e4adf0ab
3 changed files with 22 additions and 16 deletions

View File

@ -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 = "17.06.00.002";
$VERSION = "17.06.00.003";
sub version {
return $VERSION;

View File

@ -1,15 +0,0 @@
$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";
}

View File

@ -14574,6 +14574,27 @@ if ( CheckVersion($DBversion) ) {
print "Upgrade to $DBversion done (Bug 18228 - Alter table virtualshelves to simplify permissions)\n";
}
$DBversion = '17.06.00.003';
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";
}
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.