From 9e350eee19236e3a67d77f679512a970db8d7e76 Mon Sep 17 00:00:00 2001 From: Brendan Gallagher Date: Fri, 22 Apr 2016 16:27:13 -0700 Subject: [PATCH] DBREV Bug 12267 - Allow password option in Patron Attribute non functional --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_12267.perl | 17 ------------- installer/data/mysql/updatedatabase.pl | 25 +++++++++++++++++++ 3 files changed, 26 insertions(+), 18 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_12267.perl diff --git a/Koha.pm b/Koha.pm index dd3435f2d5..f80b7115da 100644 --- 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 index 2ba00f9fbc..0000000000 --- a/installer/data/mysql/atomicupdate/bug_12267.perl +++ /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; - |); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 763ad80579..ecb49455c3 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/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.