Index: branches/5.2.x/core/install/upgrades.sql
===================================================================
diff -u -r15225 -r15230
--- branches/5.2.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 15225)
+++ branches/5.2.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 15230)
@@ -2663,3 +2663,23 @@
 ALTER TABLE Languages
 	ADD HtmlEmailTemplate TEXT NULL,
 	ADD TextEmailTemplate TEXT NULL;
+
+ALTER TABLE EmailLog CHANGE fromuser `From` VARCHAR(255) NOT NULL DEFAULT '';
+ALTER TABLE EmailLog CHANGE addressto `To` VARCHAR(255) NOT NULL DEFAULT '';
+ALTER TABLE EmailLog CHANGE subject `Subject` VARCHAR(255) NOT NULL DEFAULT '';
+ALTER TABLE EmailLog CHANGE `timestamp` SentOn INT(11) NULL;
+ALTER TABLE EmailLog CHANGE `event` EventName VARCHAR(255) NOT NULL DEFAULT '';
+
+ALTER TABLE EmailLog ADD OtherRecipients TEXT NULL AFTER `To`;
+
+ALTER TABLE EmailLog
+	ADD HtmlBody LONGTEXT NULL AFTER `Subject`,
+	ADD TextBody LONGTEXT NULL AFTER HtmlBody;
+
+ALTER TABLE EmailLog ADD AccessKey VARCHAR(32) NOT NULL DEFAULT '';
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:emaillog.edit', 11, 1, 1, 0);
+
+DELETE FROM LanguageLabels WHERE PhraseKey = 'LA_PROMPT_FROMUSERNAME';
+
+INSERT INTO SystemSettings VALUES(DEFAULT, 'EmailLogRotationInterval', '-1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMailling', 'la_config_EmailLogRotationInterval', 'select', NULL, '=la_opt_EmailLogKeepNever||86400=la_opt_OneDay||604800=la_opt_OneWeek||1209600=la_opt_TwoWeeks||2419200=la_opt_OneMonth||7257600=la_opt_ThreeMonths||29030400=la_opt_OneYear||-1=la_opt_EmailLogKeepForever', 50.11, 0, 0, 'hint:la_config_EmailLogRotationInterval');
