Browse Source

DBREV Bug 12267 - Allow password option in Patron Attribute non functional

new_12478_elasticsearch
Brendan Gallagher 5 years ago
parent
commit
9e350eee19
  1. 2
      Koha.pm
  2. 17
      installer/data/mysql/atomicupdate/bug_12267.perl
  3. 25
      installer/data/mysql/updatedatabase.pl

2
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 = "3.23.00.048";
$VERSION = "3.23.00.049";
sub version {
return $VERSION;

17
installer/data/mysql/atomicupdate/bug_12267.perl

@ -1,17 +0,0 @@
my $dbh = C4::Context->dbh;
my ( $column_has_been_used ) = $dbh->selectrow_array(q|
SELECT COUNT(*)
FROM borrower_attributes
WHERE password IS NOT NULL
|);
if ( $column_has_been_used ) {
print q|WARNING: The columns borrower_attribute_types.password_allowed and borrower_attributes.password have been removed from the Koha codebase. They were not used. However your installation has at least one borrower_attributes.password defined. In order not to alter your data, the columns have been kept, please save the information elsewhere and remove these columns manually.|;
} else {
$dbh->do(q|
ALTER TABLE borrower_attribute_types DROP column password_allowed
|);
$dbh->do(q|
ALTER TABLE borrower_attributes DROP column password;
|);
}

25
installer/data/mysql/updatedatabase.pl

@ -12231,6 +12231,31 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
}
DBversion = "3.23.00.049";
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
my $dbh = C4::Context->dbh;
my ( $column_has_been_used ) = $dbh->selectrow_array(q|
SELECT COUNT(*)
FROM borrower_attributes
WHERE password IS NOT NULL
|);
if ( $column_has_been_used ) {
print q|WARNING: The columns borrower_attribute_types.password_allowed and borrower_attributes.password have been removed from the Koha codebase. They were not used. However your installation has at least one borrower_attributes.password defined. In order not to alter your data, the columns have been kept, please save the information elsewhere and remove these columns manually.|;
} else {
$dbh->do(q|
ALTER TABLE borrower_attribute_types DROP column password_allowed
|);
$dbh->do(q|
ALTER TABLE borrower_attributes DROP column password;
|);
}
print "Upgrade to $DBversion done (Bug 12267 - Allow password option in Patron Attribute non functional)\n";
SetVersion($DBversion);
}
# 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.

Loading…
Cancel
Save