Index: branches/5.2.x/core/install/upgrades.sql
===================================================================
diff -u -N -r14437 -r14447
--- branches/5.2.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 14437)
+++ branches/5.2.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 14447)
@@ -2012,4 +2012,15 @@
 SET DisplayOrder = DisplayOrder + 0.01
 WHERE `ModuleOwner` = 'In-Portal:Users' AND `Section` = 'in-portal:configure_users' AND DisplayOrder BETWEEN 10.12 AND 20.00;
 
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_AdminGroup', '11', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_admin_group', 'select', NULL, '0=lu_none||<SQL+>SELECT GroupId as OptionValue, Name as OptionName FROM <PREFIX>PortalGroup WHERE Enabled=1 AND Personal=0</SQL>', 10.12, 0, 1, NULL);
\ No newline at end of file
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_AdminGroup', '11', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_admin_group', 'select', NULL, '0=lu_none||<SQL+>SELECT GroupId as OptionValue, Name as OptionName FROM <PREFIX>PortalGroup WHERE Enabled=1 AND Personal=0</SQL>', 10.12, 0, 1, NULL);
+
+ALTER TABLE PortalUser
+	DROP INDEX Login,
+	ADD INDEX Login (Login);
+
+ALTER TABLE PortalUser CHANGE Login Login VARCHAR(255) NOT NULL;
+ALTER TABLE PortalUser ADD OldStyleLogin TINYINT NOT NULL;
+
+UPDATE PortalUser
+SET OldStyleLogin = 1
+WHERE (Login <> '') AND (Login NOT REGEXP '^[A-Z0-9_\\-\\.]+$');
\ No newline at end of file
