Reinstate 25267 now that 1.11 is branched, and add the relatively long-requested...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 7 Sep 2007 01:52:12 +0000 (01:52 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 7 Sep 2007 01:52:12 +0000 (01:52 +0000)
includes/Article.php
maintenance/tables.sql
maintenance/updaters.inc

index 7ba55c5..0e51faf 100644 (file)
@@ -2463,8 +2463,8 @@ class Article {
         *
         * @param Revision $rev
         *
-        * @todo This is a shitty interface function. Kill it and replace the
-        * other shitty functions like editUpdates and such so it's not needed
+        * @todo This is a lousy interface function. Kill it and replace the
+        * other cruddy functions like editUpdates and such so it's not needed
         * anymore.
         */
        function createUpdates( $rev ) {
index 72a779a..440921c 100644 (file)
@@ -270,6 +270,9 @@ CREATE TABLE /*$wgDBprefix*/revision (
   -- Not yet used; reserved for future changes to the deletion system.
   rev_deleted tinyint unsigned NOT NULL default '0',
   
+  -- Was this edit made by a bot (and marked as such)?
+  rev_bot tinyint unsigned NOT NULL default '0',
+  
   -- Length of this revision in bytes
   rev_len int unsigned,
 
@@ -282,7 +285,8 @@ CREATE TABLE /*$wgDBprefix*/revision (
   INDEX rev_timestamp (rev_timestamp),
   INDEX page_timestamp (rev_page,rev_timestamp),
   INDEX user_timestamp (rev_user,rev_timestamp),
-  INDEX usertext_timestamp (rev_user_text,rev_timestamp)
+  INDEX usertext_timestamp (rev_user_text,rev_timestamp),
+  INDEX page_user_timestamp (rev_page,rev_user,rev_timestamp)
 
 ) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024;
 -- In case tables are created as MyISAM, use row hints for MySQL <5.0 to avoid 4GB limit
index beadacf..4438c9a 100644 (file)
@@ -83,6 +83,7 @@ $wgNewFields = array(
        array( 'oldimage',      'oi_metadata',      'patch-oi_metadata.sql'),
        array( 'archive',       'ar_page_id',       'patch-archive-page_id.sql'),
        array( 'image',         'img_sha1',         'patch-img_sha1.sql' ),
+       array( 'revision',              'rev_bot',                      'patch-rev_bot.sql' ),
 );
 
 # For extensions only, should be populated via hooks
@@ -1031,6 +1032,8 @@ function do_all_updates( $shared = false, $purge = true ) {
        
        do_oldimage_user_index(); flush ();
 
+       do_revision_page_user_index(); flush ();
+
        echo "Deleting old default messages (this may take a long time!)..."; flush();
        deleteDefaultMessages();
        echo "Done\n"; flush();
@@ -1129,6 +1132,17 @@ function do_restrictions_update() {
        
 }
 
+function do_revision_page_user_index() {
+       global $wgDatabase;
+       if( $wgDatabase->indexExists( 'revision', 'page_user_timestamp' ) ) {
+               echo "...page,user,timestamp key on revision already exists.\n";
+       } else {
+               echo "Adding page,user,timestamp key on revision table... ";
+               dbsource( archive("patch-revision-user-page-index.sql"), $wgDatabase );
+               echo "ok\n";
+       }
+}
+
 function
 pg_describe_table($table)
 {