Overhaul site_stats table
[lhc/web/wiklou.git] / maintenance / tables.sql
index 4120a64..9aa6c20 100644 (file)
@@ -365,7 +365,7 @@ CREATE TABLE /*_*/revision (
   -- It's possible for multiple revisions to use the same text,
   -- for instance revisions where only metadata is altered
   -- or a rollback to a previous version.
-  rev_text_id int unsigned NOT NULL,
+  rev_text_id int unsigned NOT NULL default 0,
 
   -- Text comment summarizing the change. Deprecated in favor of
   -- revision_comment_temp.revcomment_comment_id.
@@ -988,26 +988,22 @@ CREATE TABLE /*_*/site_stats (
   ss_row_id int unsigned NOT NULL PRIMARY KEY,
 
   -- Total number of edits performed.
-  ss_total_edits bigint unsigned default 0,
+  ss_total_edits bigint unsigned default NULL,
 
-  -- An approximate count of pages matching the following criteria:
-  -- * in namespace 0
-  -- * not a redirect
-  -- * contains the text '[['
-  -- See Article::isCountable() in includes/Article.php
-  ss_good_articles bigint unsigned default 0,
+  -- See SiteStatsInit::articles().
+  ss_good_articles bigint unsigned default NULL,
 
-  -- Total pages, theoretically equal to SELECT COUNT(*) FROM page; except faster
-  ss_total_pages bigint default '-1',
+  -- Total pages, theoretically equal to SELECT COUNT(*) FROM page.
+  ss_total_pages bigint unsigned default NULL,
 
-  -- Number of users, theoretically equal to SELECT COUNT(*) FROM user;
-  ss_users bigint default '-1',
+  -- Number of users, theoretically equal to SELECT COUNT(*) FROM user.
+  ss_users bigint unsigned default NULL,
 
-  -- Number of users that still edit
-  ss_active_users bigint default '-1',
+  -- Number of users that still edit.
+  ss_active_users bigint unsigned default NULL,
 
-  -- Number of images, equivalent to SELECT COUNT(*) FROM image
-  ss_images int default 0
+  -- Number of images, equivalent to SELECT COUNT(*) FROM image.
+  ss_images bigint unsigned default NULL
 ) /*$wgDBTableOptions*/;
 
 --
@@ -1836,7 +1832,7 @@ CREATE TABLE /*_*/change_tag (
   ct_rev_id int unsigned NULL,
   -- Tag applied
   ct_tag varchar(255) NOT NULL,
-  -- Parameters for the tag, presently unused
+  -- Parameters for the tag; used by some extensions
   ct_params blob NULL
 ) /*$wgDBTableOptions*/;