DBREV Bug 12267 - Allow password option in Patron Attribute non functional
authorBrendan Gallagher <brendan@bywatersolutions.com>
Fri, 22 Apr 2016 23:27:13 +0000 (16:27 -0700)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Fri, 22 Apr 2016 23:27:13 +0000 (16:27 -0700)
Koha.pm
installer/data/mysql/atomicupdate/bug_12267.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index dd3435f..f80b711 100644 (file)
--- a/Koha.pm
+++ b/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;
diff --git a/installer/data/mysql/atomicupdate/bug_12267.perl b/installer/data/mysql/atomicupdate/bug_12267.perl
deleted file mode 100644 (file)
index 2ba00f9..0000000
+++ /dev/null
@@ -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;
-    |);
-}
index 763ad80..ecb4945 100755 (executable)
@@ -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.