Index: branches/5.3.x/install/upgrades.sql
===================================================================
diff -u -N -r15492 -r15671
--- branches/5.3.x/install/upgrades.sql	(.../upgrades.sql)	(revision 15492)
+++ branches/5.3.x/install/upgrades.sql	(.../upgrades.sql)	(revision 15671)
@@ -282,3 +282,7 @@
 INSERT INTO Permissions VALUES(DEFAULT, 'in-commerce:general.add', 11, 1, 1, 0);
 INSERT INTO Permissions VALUES(DEFAULT, 'in-commerce:output.add', 11, 1, 1, 0);
 INSERT INTO Permissions VALUES(DEFAULT, 'in-commerce:contacts.add', 11, 1, 1, 0);
+
+# ===== v 5.2.1-B1 =====
+ALTER TABLE Affiliates CHANGE PortalUserId PortalUserId INT(10) NULL DEFAULT NULL;
+UPDATE Affiliates SET PortalUserId = NULL WHERE PortalUserId = 0;
