Index: branches/5.1.x/core/install/upgrades.sql
===================================================================
diff -u -r13151 -r13161
--- branches/5.1.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 13151)
+++ branches/5.1.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 13161)
@@ -1650,3 +1650,5 @@
 
 DELETE FROM Phrase WHERE Phrase LIKE 'la_event_%';
 DELETE FROM PersistantSessionData WHERE VariableName = 'phrases_columns_.';
+
+UPDATE Category SET FormId = NULL WHERE FormId = 0;
