Index: branches/5.3.x/install/install_schema.sql
===================================================================
diff -u -N -r15492 -r15671
--- branches/5.3.x/install/install_schema.sql	(.../install_schema.sql)	(revision 15492)
+++ branches/5.3.x/install/install_schema.sql	(.../install_schema.sql)	(revision 15671)
@@ -663,7 +663,7 @@
 
 CREATE TABLE Affiliates (
   AffiliateId int(11) NOT NULL AUTO_INCREMENT,
-  PortalUserId int(10) unsigned NOT NULL DEFAULT '0',
+  PortalUserId int(10) DEFAULT NULL,
   AffiliatePlanId int(10) unsigned NOT NULL DEFAULT '0',
   AccumulatedAmount decimal(10,2) NOT NULL DEFAULT '0.00',
   AmountToPay decimal(10,2) NOT NULL DEFAULT '0.00',
@@ -677,8 +677,8 @@
   Comments text,
   CreatedOn int(11) DEFAULT NULL,
   PRIMARY KEY (AffiliateId),
-  UNIQUE KEY PortalUserId (PortalUserId),
   UNIQUE KEY AffiliateCode (AffiliateCode),
+  UNIQUE KEY PortalUserId (PortalUserId),
   KEY LastOrderDate (LastOrderDate),
   KEY AffiliatePlanId (AffiliatePlanId),
   KEY `Status` (`Status`),
