Bugzilla – Attachment 33985 Details for
Bug 1861
Unique patrons logins not (totally) enforced
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PUSHED] Bug 1861 [QA Followup] - Don't modify userids, warn if we can't modify the index automatically
PASSED-QA-Bug-1861-QA-Followup---Dont-modify-useri.patch (text/plain), 1.96 KB, created by
Martin Renvoize (ashimema)
on 2014-11-27 09:07:57 UTC
(
hide
)
Description:
[PUSHED] Bug 1861 [QA Followup] - Don't modify userids, warn if we can't modify the index automatically
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2014-11-27 09:07:57 UTC
Size:
1.96 KB
patch
obsolete
>From e906036a759b72cffbca71cdfc56ace03f12d675 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 20 Nov 2014 11:01:08 -0500 >Subject: [PATCH] [PASSED QA] Bug 1861 [QA Followup] - Don't modify userids, > warn if we can't modify the index automatically > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > installer/data/mysql/updatedatabase.pl | 22 +++++++++++++--------- > 1 file changed, 13 insertions(+), 9 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 9600018..b829110 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9575,17 +9575,21 @@ if ( CheckVersion($DBversion) ) { > > $DBversion = "3.17.00.XXX"; > if ( CheckVersion($DBversion) ) { >- $dbh->do(q{ >- UPDATE borrowers SET userid = NULL where userid = "" >- }); >+ my ($count) = $dbh->selectrow_array("SELECT COUNT(*) FROM borrowers GROUP BY userid HAVING COUNT(userid) > 1"); > >- $dbh->do(q{ >- ALTER TABLE borrowers >- DROP INDEX userid , >- ADD UNIQUE userid (userid) >- }); >+ if ( $count ) { >+ print "Upgrade to $DBversion done (Bug 1861 - Unique patrons logins not (totally) enforced) FAILED!\n"; >+ print "Your database has users with duplicate user logins. Please have your administrator deduplicate your user logins.\n"; >+ print "Afterward, your Koha administrator should execute the following database query: ALTER TABLE borrowers DROP INDEX userid, ADD UNIQUE userid (userid)"; >+ } else { >+ $dbh->do(q{ >+ ALTER TABLE borrowers >+ DROP INDEX userid , >+ ADD UNIQUE userid (userid) >+ }); >+ print "Upgrade to $DBversion done (Bug 1861 - Unique patrons logins not (totally) enforced)\n"; >+ } > >- print "Upgrade to $DBversion done (Bug 1861 - Unique patrons logins not (totally) enforced)\n"; > SetVersion($DBversion); > } > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 1861
:
29573
|
29616
|
30561
|
30828
|
33143
|
33144
|
33749
|
33750
|
33751
|
33752
|
33983
|
33984
| 33985 |
34820
|
34821
|
34822
|
34823