Index: branches/5.2.x/core/install/upgrades.sql
===================================================================
diff -u -N -r14692 -r14726
--- branches/5.2.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 14692)
+++ branches/5.2.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 14726)
@@ -2193,3 +2193,31 @@
 UPDATE ConfigurationValues
 SET DisplayOrder = DisplayOrder + 0.01
 WHERE `Section` = 'in-portal:configure_advanced' AND Heading = 'la_section_SettingsWebsite';
+
+
+UPDATE ItemTypes
+SET TitleField = 'Username'
+WHERE SourceTable = 'PortalUser' AND TitleField = 'Login';
+
+UPDATE SearchConfig
+SET FieldName = 'Username'
+WHERE TableName = 'PortalUser' AND FieldName = 'Login';
+
+ALTER TABLE PortalUser DROP INDEX Login;
+ALTER TABLE PortalUser CHANGE Login Username VARCHAR(255) NOT NULL;
+ALTER TABLE PortalUser ADD INDEX Username (Username);
+
+UPDATE Events
+SET
+	l<%PRIMARY_LANGUAGE%>_Subject = REPLACE(l<%PRIMARY_LANGUAGE%>_Subject, 'name="Login"', 'name="Username"'),
+	l<%PRIMARY_LANGUAGE%>_Body = REPLACE(l<%PRIMARY_LANGUAGE%>_Body, 'name="Login"', 'name="Username"');
+
+DELETE FROM PersistantSessionData
+WHERE (VariableName LIKE 'u%]columns_.') OR (VariableName LIKE 'u%_sort%');
+
+DELETE FROM Phrase
+WHERE Phrase = 'LU_FLD_LOGIN';
+
+UPDATE BanRules
+SET ItemField = 'Username'
+WHERE ItemField = 'Login';
\ No newline at end of file
