# - #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;
+++ /dev/null
-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;
- |);
-}
}
+
+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.