Index: branches/5.2.x/core/install/upgrades.sql
===================================================================
diff -u -r14572 -r14585
--- branches/5.2.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 14572)
+++ branches/5.2.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 14585)
@@ -2020,8 +2020,42 @@
 # ===== v 5.1.2 =====
 
 # ===== v 5.1.3-B1 =====
+ALTER TABLE FormSubmissions CHANGE ReferrerURL ReferrerURL TEXT NULL;
 INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UserEmailActivationTimeout', '', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_config_UserEmailActivationTimeout', 'text', NULL, NULL, 10.051, 0, 0, NULL);
 
+# ===== v 5.1.3-B2 =====
+ALTER TABLE Modules ADD AppliedDBRevisions TEXT NULL;
+
+# ===== v 5.1.3-RC1 =====
+
+# ===== v 5.1.3-RC2 =====
+UPDATE Events
+SET l<%PRIMARY_LANGUAGE%>_Subject = 'New User Registration (<inp2:u_Field name="Login"/><inp2:m_if check="m_GetConfig" name="User_Allow_New" equals_to="4"> - Activation Email</inp2:m_if>)'
+WHERE Event = 'USER.ADD.PENDING' AND `Type` = 0 AND l<%PRIMARY_LANGUAGE%>_Subject LIKE '%<inp2:m_if check="m_GetConfig" name="User_Allow_New" equals_to="4"> - Activation Email</inp2:m_if>)%';
+
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaxUserName', '', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_text_min_username', 'text', '', 'style="width: 50px;"', 10.03, 2, 0, NULL);
+UPDATE ConfigurationValues
+SET GroupDisplayOrder = 1, ValueList = 'style="width: 50px;"'
+WHERE VariableName = 'Min_UserName';
+
+UPDATE Phrase
+SET l<%PRIMARY_LANGUAGE%>_Translation = 'User name length (min - max)'
+WHERE PhraseKey = 'LA_TEXT_MIN_USERNAME' AND l<%PRIMARY_LANGUAGE%>_Translation = 'Minimum user name length';
+
+# ===== v 5.1.3 =====
+UPDATE PortalUser
+SET Modified = NULL;
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site_domains.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site_domains.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site_domains.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:site_domains.view', 11, 1, 1, 0);
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:country_states.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:country_states.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:country_states.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:country_states.view', 11, 1, 1, 0);
+
 # ===== v 5.2.0-B1 =====
 ALTER TABLE PortalUser
 	ADD UserType TINYINT NOT NULL,
