@@ -, +, @@ --- installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/updatedatabase.pl | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletions(-) --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -269,7 +269,7 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons PRIMARY KEY `borrowernumber` (`borrowernumber`), KEY `categorycode` (`categorycode`), KEY `branchcode` (`branchcode`), - KEY `userid` (`userid`), + UNIQUE KEY `userid` (`userid`), KEY `guarantorid` (`guarantorid`), KEY `surname_idx` (`surname`(255)), KEY `firstname_idx` (`firstname`(255)), --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -9525,6 +9525,22 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.17.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + UPDATE borrowers SET userid = NULL where userid = "" + }); + + $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"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --