Index: branches/5.1.x/core/install/upgrades.sql
===================================================================
diff -u -r13086 -r13140
--- branches/5.1.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 13086)
+++ branches/5.1.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 13140)
@@ -1620,4 +1620,28 @@
 
 # ===== v 5.0.2-RC1 =====
 
-# ===== v 5.0.2 =====
\ No newline at end of file
+# ===== v 5.0.2 =====
+
+# ===== v 5.1.0-B1 =====
+DROP TABLE EmailMessage;
+DELETE FROM PersistantSessionData WHERE VariableName = 'emailevents_columns_.';
+
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId)
+SELECT 'in-portal:configemail.add' AS Permission, GroupId, PermissionValue, Type, CatId
+FROM <%TABLE_PREFIX%>Permissions
+WHERE Permission = 'in-portal:configemail.edit';
+
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId)
+SELECT 'in-portal:configemail.delete' AS Permission, GroupId, PermissionValue, Type, CatId
+FROM <%TABLE_PREFIX%>Permissions
+WHERE Permission = 'in-portal:configemail.edit';
+
+UPDATE Events e
+SET e.l1_Description = (
+	SELECT p.Translation
+	FROM <%TABLE_PREFIX%>Phrase p
+	WHERE (p.Phrase = e.Description) AND (p.LanguageId = 1)
+);
+
+ALTER TABLE Events DROP Description;
+DELETE FROM Phrase WHERE Phrase LIKE 'la_event_%';
