Index: branches/5.1.x/core/install/upgrades.sql
===================================================================
diff -u -N -r13951 -r13962
--- branches/5.1.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 13951)
+++ branches/5.1.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 13962)
@@ -1951,4 +1951,29 @@
 	ADD INDEX ( `Protected` );
 
 UPDATE Category SET `Type` = IF(`Protected` = 1, 2, 1);
-UPDATE Category SET `Protected` = 1 WHERE ThemeId > 0;
\ No newline at end of file
+UPDATE Category SET `Protected` = 1 WHERE ThemeId > 0;
+
+ALTER TABLE Category CHANGE CachedDescendantCatsQty CachedDescendantCatsQty INT(11) NOT NULL DEFAULT '0';
+ALTER TABLE Events CHANGE `Module` `Module` VARCHAR(40) NOT NULL DEFAULT 'Core';
+
+ALTER TABLE Language
+	CHANGE DateFormat DateFormat VARCHAR(50) NOT NULL DEFAULT 'm/d/Y',
+	CHANGE TimeFormat TimeFormat VARCHAR(50) NOT NULL DEFAULT 'g:i:s A',
+	CHANGE DecimalPoint DecimalPoint VARCHAR(10) NOT NULL DEFAULT '.',
+	CHANGE Charset Charset VARCHAR(20) NOT NULL DEFAULT 'utf-8';
+
+ALTER TABLE ItemReview CHANGE Rating Rating TINYINT(3) UNSIGNED NOT NULL DEFAULT '0';
+UPDATE PortalUser SET tz = NULL;
+
+ALTER TABLE Category
+	CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL,
+	CHANGE ModifiedById ModifiedById INT(11) NULL DEFAULT NULL;
+UPDATE Category SET CreatedById = NULL WHERE CreatedById = 0;
+UPDATE Category SET ModifiedById = NULL WHERE ModifiedById = 0;
+
+ALTER TABLE ItemFiles CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL;
+
+ALTER TABLE Drafts CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL;
+UPDATE Drafts SET CreatedById = NULL WHERE CreatedById = 0;
+
+ALTER TABLE ItemReview CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL;
\ No newline at end of file
